Skip to content
Smart Templates Manual Website Manual for your AI

Buttons: the assistant

In short

With a button in Dynamics, the document is created with one click, right on the record and without the designer. You create the button in the command designer of Power Apps; the assistant that the button “🖨 Manage buttons in Dynamics” opens leads you there question by question and provides every value you have to enter, ready to copy. This page describes the assistant’s questions and how to use it. The steps in the command designer are described under Adding, changing and removing a button, and what users see on click under What happens on click. The button “↻ Manage flows” opens a window in which you create flows in Power Automate that carry on afterward, for example filing the document in SharePoint; it is described under Flows. Neither window changes anything on the sheet.

What a button can do

A button is an additional button in Dynamics. It sits in the bar with buttons such as “Save” or “New”, which Dynamics calls the “command bar”, and it can be in one of three places:

  • On the record: in the bar above the open form. In the image, a Smart Templates button, “Create PDF”, is already there.
    The head of a form in Dynamics, app Vertriebshub: at the top the dark bar with “Dynamics 365” and “Vertriebshub”, on the left the menu with Home, Recent, Pinned and My Work. To the right of it the command bar with an arrow back, an icon for a new window, “Create PDF”, “Save”, “Save & Close”, “Transaktionen für Rec…”, “Neu berechnen” and “Flow”. Below it the title “Rechnung erstellen” with “Rechnung · Rechnungsübersicht” and the tabs Zusammenfassung, Zahlungen, Abschlagsrechnungen, Anhänge and Monatsabrechnung Verweise.
    On the record: the bar above the form of a new invoice, with the button “Create PDF”.
  • In a subgrid: in the small bar of a list in the middle of the form, here the line items of an invoice.
    The section “Produkte & Dienstleistungen” in the form of an invoice: on the left the view “Positionserfassung”, on the right above it the small bar with “Refresh”, “Flow”, “Run Report”, “Excel Templates” and three dots. Below it a list with the columns Pos., Menge, Vorhandenes Produkt, Produktbeschreibung, Einzelpreis, Betrag and others; it contains two line items, an oxidation catalyst and a gasket set.
    In a subgrid: the small bar above the list of line items, not the large bar at the top of the form.
  • In a view: in the bar above the list of a table, here “Alle Rechnungen”. Here the user first checks one or more rows.
    The view “Alle Rechnungen” in the Sales Hub: at the top the command bar with “Show As”, “Show Chart”, “New”, “Delete”, “Refresh”, “Visualize this view”, “Email a Link”, “Flow” and “Run Report”. Below it the title “Alle Rechnungen” and the column heads Vorgang, Name, Vorgangsart, Rechnungsnummer, Kunde, Statusgrund, Offener Brutto, Brutto Endbetrag and others. Below that four invoices, for example “Wartungsvertrag 2026” for Contoso Handels GmbH for 2,856.00 €.
    In a view: the bar above the list of all invoices.

In the assistant, the three places are called “Main form”, “Subgrid view” and “Main grid” (see Where in “Table”?). With one click, the button creates the document from your template. It can do three things:

  • Create and display the document: The document opens in a new tab. Nothing is stored and nothing is sent in Dynamics.
  • Prepare an email and present it: An email draft with the document attached opens; you check and send it yourself.
  • Send email immediately: The email goes out without a prompt, to a recipient from the record (a lookup such as the customer, or an email field, see Who receives the email?) or to the record itself if the template prints a contact, an account, a lead, a user or a queue.

All three create the same document. It corresponds to what the button “PDF” in the designer creates, but from the saved version of the template and with the record on which the button is clicked, instead of the sample record. If the button sits on a different table than the template, it is the record at the end of the path. These differences and what else depends on the printing user and on the point in time are described under Full preview and PDF: Full preview and printing in Dynamics.

If the template has a switched-on e-invoice (see E-invoice: ZUGFeRD and XRechnung), a fourth purpose is added: “Download e-invoice”. It delivers only the template’s e-invoice as an XML file to save, without a document in a tab and without a flow. The other three purposes then deliver what the template sets (see E-invoice: Button, email and flow).

There is an assistant for the button. Click through its questions; it explains every choice along the way. At the end you get instructions on what to enter where in the command designer, with every value ready to copy. Further down this page, every step is described once more in detail, in case you want to look something up; the steps in the command designer are described under Adding, changing and removing a button. You can set up a button only for a template that has already been stored in Dynamics (see The window “Not yet saved in Dynamics”). What the administrator has to prepare is described in Preparing buttons and flows.

The two buttons in the header bar

In the header bar of the designer there are two buttons in a group of their own to the right of “Full preview” and “PDF” (see The header bar). Both are always there, both open a window of their own, and neither changes anything on the sheet.

ButtonWhat it doesTooltip
“🖨 Manage buttons in Dynamics” Opens the assistant, the window “Manage buttons in Dynamics”. With it you plan, change or remove, step by step, a button in Dynamics that creates the document from this template with one click or sends it by email. If the template has no ID because it is not stored in any record in Dynamics, only a notice window appears instead. The button used to be called “🖨 Drucken & Senden einrichten”. “Create, change or remove a button in Dynamics that creates the document from this template with one click or sends it by email. An assistant guides you step by step.”
“↻ Manage flows” Opens the window Manage flows: create, open and remove cloud flows (Power Automate) for this template. The flow is created here, and it is edited in Power Automate. The window also opens for a template that is not yet in Dynamics, because there is no ID check here. The services behind it exist only in Dynamics. A flow that you create here is in the assistant’s flow list the next time it is opened. If you open the window from the assistant via “Create flow …”, the assistant selects the new flow right away (see The button “Create flow …”). “Create, open and remove cloud flows (Power Automate) for this template — the flow is created here and edited in Power Automate.”

If one of the two buttons is missing, an old browser cache is usually to blame, or an update that was only partly renewed. Otherwise the designer stays usable. Reload the page with Ctrl+Shift+R; if that does not help, the administrator has to redeploy the designer.

The window “Not yet saved in Dynamics”

If the open template has no ID, for example because it was opened from a file and never stored in Dynamics, this window opens instead of the assistant. It has only one button, “Got it”; there is no “Cancel”. The text reads: “This template is not stored in any record in Dynamics yet, so it has no ID. Use »Duplicate« to save it there (»New« would replace it with an empty one) — after that the finished instructions, with everything to copy, appear here.” “Here” means the assistant.

The focus is on “Got it”, so the Enter key closes the window just like Escape or a click next to the window. The assistant does not open afterward. The template’s ID belongs later, in the command designer, on the button as the second parameter; without it there are no finished instructions. How to store a template is described under Managing templates: Duplicate.

The assistant: process and operation

At the top of the header bar, click “🖨 Manage buttons in Dynamics”. In the first step you choose whether you want to create a button, change an existing one or remove one. The assistant reads apps, tables, email templates, flows, existing buttons and relationships fresh from Dynamics every time it opens. Outside Dynamics, for example with a local call of the designer, it cannot read anything and says so.

The assistant stores almost nothing. Everything you choose lives only in the window and is gone when you close it. The only exception is the email template’s if-then cases: it writes them into the open template. They are stored in Dynamics only once you then press “Save” at the top as usual.

The steps at a glance

The branch “Create a button” has 7 to 11 steps, depending on whether the path, the question about several rows and, for the email purposes, the steps Who and Email template are added. For the purpose “Download e-invoice”, the step Flow is omitted, and Who and Email template are never added; it is then 6 to 8 steps. The instructions at the end have 13 to 20 numbered steps in this branch (see Adding, changing and removing a button: The steps for creating a button).

StepQuestion in the assistantWhen it appears
Start“What would you like to do?”always
App“Which app should the button be in?”always
Table“Which table should the button be on?”always
Path“How do you get from here to the template?”only if the chosen table is a different one than the primary source of the template
Place“Where in »Table«?”always
Several rows“Does it matter what the user checks?”only for the three list places
Purpose“What should the button do?”always
Who“Who receives the email?”only for the two email purposes
Email template“Which email template?”only for the two email purposes
Flow“Should a Power Automate flow run afterwards?”always, except for the purpose “Download e-invoice”
Instructions“Step by step”always, in the last step

In the branches “Change an existing button” and “Remove a button”, there are three steps: the start, the choice of the button and the instructions with four steps. See Adding, changing and removing a button: Changing or removing a button.

The window

ControlWhat it does
Size and position A wide window that adapts to the window width on narrow screens. The content scrolls, the footer bar with counter and buttons stays in place. Resizing and position as with all windows (see Problems and messages: The windows).
Close There is no ✕ in the corner. It is closed with “Close” (in the start step before the first choice, in the last step and in the error state), with the Escape key or with a click next to the window (see Keyboard shortcuts: Esc in detail), always without a prompt. After that, the assistant’s state is gone, and the next time it opens it starts again at step 1. Only the if-then cases that have already been written into the open template remain; they are read again when it opens.
Further windows on top If you open “Manage flows” from the assistant, this window lies over the assistant, and from there the connection instructions (see Flows: The windows “Create a connection” and “First the connection — here is how”) lie over it once more. Escape always closes the topmost one.

The footer bar

ControlWhat it does
Step n of m (left) Counts the steps of the chosen branch. Before the first choice it says only “Step 1”; the total comes only with the choice. When creating, it is 7 to 11 steps (6 to 8 for the purpose “Download e-invoice”), when changing and removing 3.
Orange line with “·” in front Names what is still missing before “Continue ▸”. As long as it is there, “Continue ▸” is disabled. The texts are under The orange line.
“◂ Back” Goes back one step. The button is always there from the second step on, also in the last one: you can jump back at any time and change something. The choices so far stay as they are, apart from the consequences described under What lapses when you change earlier choices.
“Continue ▸” (highlighted) Goes to the next step. The button is in every step except the last and is disabled as long as the orange line names something. When first opened, it is missing in the start step: there, a click on a card already moves on, and “Close” is on the right. If you later return to the start with “◂ Back”, it is there too.
“Close” It is in the start step as long as nothing has been chosen yet, in the last step and, at startup, in the error state. Closes the assistant without a prompt.

The orange line

The line names, per step, what is missing. Place and purpose have defaults and never block. Several rows, Who and Flow also have defaults and block only in the special cases named.

StepText of the line
Start“Please choose what you want to do.”
App“Please choose an app.”
Table“Please choose a table.”
Path“The path has not reached »name of the primary source« yet.”
Several rows“Please choose.” Practically never seen, because “Exactly one record” is preselected.
Who, card “From a lookup of the record” or “From an email field of the record” chosen“Please choose a lookup.” or “Please choose an email field.” As long as the list is at “— please choose —”.
Who, purpose “Send email immediately”, card “As before …”“»Send email immediately« needs a recipient for this template — please choose a lookup or an email field.” Only if the template’s primary source is not itself a recipient.
Who, purpose “Send email immediately”, card “As before …”, and the table of the primary source has neither a suitable lookup nor an email field“»Send email immediately« does not work for this template — it has neither a lookup to a recipient nor an email field.” Go back and choose “Prepare an email and present it”.
Email template, “Always the same template”“Please choose an email template.”
Email template, “Depending on a condition”“Please specify at least one complete case or an otherwise branch.” When a case is complete is described under Depending on a condition: the cases.
Flow“Please choose a flow — or »No« above.”
Choose a button (change, remove)“Please choose a button.”

Selection cards

Most questions you answer with a card. The whole card is clickable and acts like a radio button: the chosen one carries “● ” in front of the title, a blue border and a pale blue background, all others “○ ”. On the left, depending on the step, there is a character (+ ✎ 🗑 ✉ ⑂ — ↗ @ ↻), a drawn symbol, a small sketch or the image of the app; if the app image is missing or does not load, “▦” appears. Names from Dynamics, that is, apps, tables, email templates, flows and the labels of existing buttons, are data and are not translated in the English interface.

Copy lines

A value that you enter later in the command designer is in a copy line: on the left the label, next to it a read-only field in monospaced type and on the right the button “Copy”. A click in the field selects the whole content. “Copy” puts the value on the clipboard and shows “Copied ✓” for 1.4 seconds. If that does not work, the button says “Copy manually”: click in the field and copy with Ctrl+C. Below it there is often a short note on the spelling.

The copy line is at the step where you need the value, not collected in one block. It occurs in the step Path (“The path”) and in the instructions (Adding, changing and removing a button: The instructions in the command designer): “… or the link”, “Suggestion”, “Library” twice, “Function”, “Parameter 2” to “Parameter n”, “Formula (Power Fx)” and, when changing, “This template”.

Loading and errors

As long as a step is fetching data from Dynamics, a sentence appears instead of an empty list, so that an empty selection does not look like “there are none”. The step triggers the loading itself as soon as it appears, not the button “Continue ▸”. The footer bar with its buttons is already there; only when opening, while the apps are being loaded, is it still empty.

WhereSentence in the content area
when opening“Loading apps …”
Table“Loading the tables of the app …”
Who“Loading fields …”
Email template“Loading email templates …”
Flow“Searching for cloud flows …”
Choose button“Searching for existing buttons …”
Path“Loading relationships …”
otherwise“Loading …”; rarely, in the step itself, also “Loading tables …” and “Searching for buttons …”

If loading fails, there are two kinds of error boxes, both with an orange border:

  • Error at startup: If reading the app list or the environment ID fails, only this box remains, and the footer bar shows only “Close”. In Dynamics it says: “The app list and the environment ID could not be read. The reason:”, followed by the server’s message. If the environment ID comes back empty, the reason is “The environment ID came back empty.” Without Dynamics, with a local call of the designer, it says, in substance: This window needs Dynamics; locally there is neither the app list nor the environment ID, please open the designer in Dynamics. The assistant needs the environment ID for the link into the command designer.
  • Error in a step: A sentence names what could not be fetched (“The tables of this app could not be fetched: …”, correspondingly for email templates, buttons, the relationships of a table and the fields of the template table), followed by the reason, shortened to 300 characters. Below it says: “That does not mean they do not exist — Dynamics just did not respond (missing read permission, timeout or network).” The button “↻ Try again” discards the error and reloads. The flow list has the sentence “The flow list could not be fetched: …” instead, without this button but with “Create flow …”.

What lapses when you change earlier choices

If you go back and change something, you have to make the discarded choices again later. The orange line says in each case what is missing.

You changeWhat lapses
the appthe table choice with the table list, the email templates with the choice, and the flow list with the choice
the tablethe email templates with the choice, the flow list with the choice and the whole path (levels, search, expanded tree)
the purposethe flow list and the flow choice. “Yes, start this flow” stays checked, and the orange line asks for a new flow. “No, no flow” clears the flow choice. The choice under “Who receives the email?” stays; when displaying, it has no effect.
the placenothing. But it decides whether the step “Several rows” appears and whether the entry in the field “Function” ends in “All”.

A click on a card redraws the step, and the scroll position stays. The content jumps to the top only on a change of step, in the Path step on a new level or when a collection question opens or closes, in the Who step on a switch between the three cards, in the email step on a switch between “Always the same template” and “Depending on a condition”, and in the Flow step on a switch between “No, no flow” and “Yes, start this flow”.

The first steps: action, app and table

What would you like to do?

Above the three cards is the question “What would you like to do?”. Above it, a blue box explains what it is about. If the template has no name, “(no name)” appears instead of the name. The box says, in substance: A button in Dynamics creates the finished document from the template with one click, right on the record and without the designer. Depending on the setting, it shows the document, opens an email with the document attached or sends it right away. Under “What happens next”, three points follow:

  1. Below you choose whether you want to create, change or remove a button.
  2. The assistant then asks, step by step, where the button should be and what it should do.
  3. You do the last step yourself in Power Apps, the tool for customizing Dynamics. Instructions with images show every step, and what you have to enter is ready to copy.
The window “Manage buttons in Dynamics” in the first step, a white window with rounded corners on a light gray background. At the top, in a light blue box, is an explanatory text: A button in Dynamics creates the finished document from the template “Rechnung Standard” with one click, right on the record and without the designer; depending on the setting, it shows the document, opens an email with the document attached or sends it right away. Below it follows the subheading “What happens next” with three numbered points. Under the question “What would you like to do?” are three cards one below the other, each with an empty circle before the title: “Create a button” with a plus sign, “Change an existing button” with a pencil and “Remove a button” with a wastebasket, each with a sentence below. The footer bar shows “Step 1” on the left and in orange “Please choose what you want to do.”, on the right the button “Close”.
The first step of the assistant. The names of apps, tables and flows in the following images are examples; in your environment you will see your own.
  1. 1The light blue box says what a button does and how to continue.
  2. 2The three cards under “What would you like to do?”. A click chooses a card and jumps right to the next step; a “Continue ▸” is not needed here.
  3. 3The footer bar counts the steps, here “Step 1”. The orange line names what is still missing.
  4. 4“Close” ends the assistant without a prompt.
CardWhat it doesDefault
“Create a button” (+) Text: “A new button in Dynamics that prints this template or sends it as an email.” Chooses the branch “create” and jumps right to the App step, without “Continue ▸”. none
“Change an existing button” (✎) Text: “Label, location or template of a button that already exists.” Jumps right to “Which button do you want to change?”; the instructions follow after that. none
“Remove a button” (🗑) Text: “A button that is no longer needed.” Jumps right to “Which button do you want to remove?”; the instructions for removing follow after that. none

Which app should the button be in?

The explanatory text reads: “A modern command always belongs to exactly one app. If you want it in several, it has to be created in each one separately.” Below it is a card for every app of the environment that is switched on, sorted by name. It shows the app’s image, its name and below it its description, or else its technical short name. A click chooses the app. It determines the table list in the next step and the app in the link to the command designer.

The assistant reads at most 250 apps; it does not show more and does not say so. There is no sentence of its own for an empty list: then nothing can be chosen, and the orange line says “Please choose an app.” A different app discards the table, the email templates and the flow choice.

Which table should the button be on?

Explanatory text: “The table whose record the user has in front of them when they click.” This means the table on which the button will later sit in Dynamics, not necessarily the table of your template (see Data sources and relationships: The primary source).

ElementWhat it does
“Search … (N tables in this app)” Filters the table list as you type. A hit is every table whose display name or logical name contains the search text, regardless of upper and lower case. N is the number of all tables of the app.
Table rows (○ / ●) Each row shows the display name in bold and below it the logical name in monospaced type. For the template’s table, “· the table of this template” appears after it. A click chooses the table; a different choice discards email templates, flow and path. It is sorted by display name. At most 40 hits are shown. Only tables that belong to the components of the app are listed (the assistant reads at most 1,000 components) and that are valid in the Advanced Find of Dynamics.
Notes below the list “… and N more. Please search more precisely.” appears with more than 40 hits, “No table of this name in »App«.” if the search finds nothing.
Orange note line Appears only if you have chosen a table that is not the template’s primary source. In substance: This template prints “primary source”, but the button is to sit on “table”. That works; in the next step you choose the relationship through which one leads to the other. If the template has no primary source, there is neither this comparison nor the Path step.

The path

This step appears only if the chosen table is a different one than the primary source of the template, for example if the button sits on the invoice line but the template prints the invoice. In this step you determine through which chain of relationships the button gets from the open record to the template’s record on click. The assistant chooses nothing itself, because there are often several suitable lookups. The explanatory text says: The button sits on “table of the button”, but the template prints “primary source”; choose the relationship through which one leads to the other, across several levels if need be.

The window “Manage buttons in Dynamics” in the step “How do you get from here to the template?”. Under an explanatory text that names the invoice line and the invoice, a single field with a light blue background, “Rechnungsposition”, appears as a breadcrumb. Below it the sentence “One relationship leads from here directly to »Rechnung« — it is marked below.” and a wide search box “Search relationship … (5 on this level)” with a magnifier icon. In a bordered area is a tree: the root “Rechnungsposition” and below it five rows, each with a small arrow for expanding and a colored badge. Four carry the blue badge “N:1” (“Rechnung · Rechnungs-ID”, “Produkt · Produkt”, “Einheit · Einheit” and “Benutzer · Besitzer”), the last one the violet badge “1:N” (“Notiz · Bezug”). At the right edge of the first row is a rounded button filled blue, “✓ Target — take this path”; in the four other rows is a white button with a blue border each, “Path via this row”. Below the tree, three short lines explain the signs. The footer bar shows “Step 4 of 8”, in orange “The path has not reached »Rechnung« yet.”, the button “Back” and a pale, disabled “Continue”.
The step “How do you get from here to the template?” (in this chapter, for short: the path) for a button on the invoice line whose template prints the invoice. The relationship names are examples and depend on your environment.
  1. 1The breadcrumb shows the path so far; the current level is highlighted in light blue.
  2. 2The sentence says whether the target can be reached directly from here.
  3. 3The search box narrows the relationships of the current level as you type.
  4. 4The row “Notiz · Bezug” carries the badge “1:N”: there there can be several entries, so the assistant asks which one applies. The badge “N:1” in the rows above leads to exactly one record.
  5. 5The filled button “✓ Target — take this path”: this relationship leads directly to the template’s table; the click accepts the path.
  6. 6A bordered button “Path via this row” accepts the path up to this row; from there it goes one level further.
  1. Read the line above the tree. It says whether the target can be reached directly from the current table.
  2. In the relationship tree, expand relationships with ▸ until you find the right one. With “🔍 Search relationship …” you narrow down the list.
  3. On the right of the row you want, click “✓ Target — take this path” or “Path via this row”. The path up to this row is accepted, even if it went across several levels. The search is cleared, the content jumps to the top, and the breadcrumbs show the path so far.
  4. If the level can have several entries, answer the question of which one applies.
  5. If the blue box “✓ The path leads to the target” is there, test the path with “▸ Try the path on a real record” and continue with “Continue ▸”.

Breadcrumb, line above the tree, and tree

ElementWhat it does
Breadcrumbs (table ▸ level ▸ …) Show the path so far, starting from the button’s table. The current level is highlighted. Every earlier level is a button: a click goes back there and discards all later levels. The first breadcrumb, the button’s table, discards the whole path. This is the only way to change a question about several entries that has already been answered: cut off the level and choose again.
Line above the tree Says whether the target can be reached directly from here. With one relationship: “One relationship leads from here directly to »target« — it is marked below.” With several: “There are N relationships that lead from here directly to »target«. Only you know which one is right — that is why we ask.” With none: “No relationship leads from here directly to »target«. Expand the relationships to see what lies behind them — the path may go across several levels.”
“🔍 Search relationship … (N on this level)” Searches in the relationship tree. What is expanded stays expanded while you type.
Relationship tree (▸ expand, badges 1:N and N:1) Shows the relationships of the current table in an area of its own with a scroll bar. The tree loads further levels only when you expand them; this way you see several levels at once. Relationships are called “table · field” so that those with the same name can be told apart. Fields, dragging, rules and your own variables do not exist here: only a path is chosen. Collections (1:N) are expressly allowed. The tree remembers what you have expanded. What the badges mean is described under Data tree and field picker: What the badges and additions mean.
“✓ Target — take this path” and “Path via this row” The button on the right of every relationship. Relationships that lead directly to the template’s table carry the filled blue button “✓ Target — take this path”; all others the bordered “Path via this row”. Both accept the path up to this row, even across several levels at once (tooltip: “Use the path up to this row”). If the relationship cannot be resolved, an orange request appears to expand the branch once more and try again.
Footnote below the tree Explains the signs: ▸ expands a relationship and shows what lies behind it; the blue button on the right accepts the path up to this row; filled means this row is already at the target; 1:N means there can be several, then it asks which one applies.

The question: Which entry applies?

If a level is a collection (1:N), for example several invoices for one order, an orange card appears: “»relationship« can have several entries — which one applies?” Below it says: “When clicked, the button must print exactly one record. Without this information it could not continue.” As long as the question is open, the step shows only breadcrumbs and questions. There is deliberately no default: which record applies must not be decided silently. After the answer, the question disappears. In the path text, the answer is at the end of this level (genau1, neueste or aelteste, see the copy line “The path” under The path is done).

The window “Manage buttons in Dynamics” in the step “How do you get from here to the template?”, view after choosing a collection. Two levels are shown as breadcrumbs: on the left “Auftrag” white with a border, a small arrow, then with a light blue background “Rechnung · Auftrag”. Below is a large card with a light orange background and an orange border. Its heading reads “»Rechnung · Auftrag« can have several entries — which one applies?”, below it the sentence “When clicked, the button must print exactly one record. Without this information it could not continue.” In the card are three white answer fields with an empty circle: “Only if there is exactly one” (with the addition “If there are several, the button stops and says so. The safest choice.”), “The newest” (“Sorted by creation date; the most recent wins.”) and “The oldest” (“Sorted by creation date; the oldest wins.”). The footer bar shows “Step 4 of 8”, in orange “The path has not reached »Rechnung« yet.”, “Back” and a pale, disabled “Continue”.
A collection in the path, here several invoices for one order: The assistant asks which entry should apply. There is no preselection.
  1. 1The chosen level is a collection (1:N): several invoices can belong to one order.
  2. 2The orange card asks the question. As long as it is open, the step shows only breadcrumbs and the question.
  3. 3The three answers, without preselection: choose exactly one; it will later be at the end of the level in the path text.
  4. 4The orange line in the footer bar and the pale “Continue ▸”: Without an answer, “Continue ▸” stays disabled.
ChoiceWhat it doesDefault
“Only if there is exactly one” “If there are several, the button stops and says so. The safest choice.” On click, the button fetches two entries in order to recognize “several”. The path text says genau1. none
“The newest” “Sorted by creation date; the most recent wins.” The path text says neueste. none
“The oldest” “Sorted by creation date; the oldest wins.” The path text says aelteste. none

The path is done: test and path text

The window “Manage buttons in Dynamics” in the step “How do you get from here to the template?”, view with a finished path. As breadcrumbs are “Auftrag”, an arrow and, with a light blue background, “Rechnung · Auftrag”. Below it a light blue box with a blue border and the bold heading “✓ The path leads to the target: Rechnung” and two sentences: When clicked, the button reads its way from “Auftrag” to here and then prints the record it finds; use the breadcrumbs above to go back if you want a different path. Below it, on the left, is the white button “▸ Try the path on a real record”, to the right of it the sentence “Takes any »Auftrag« record and follows the path.” Then follows the line “The path” with a read-only field in monospaced type that contains salesorderid<invoice:invoiceid:neueste, and the button “Copy”; below it “This is exactly what the button carries later as a parameter.” The footer bar shows “Step 4 of 8”, “Back” and a blue-filled “Continue ▸”.
The finished path with the text that the button later receives as a parameter.
  1. 1The blue box “✓ The path leads to the target”: Only when it is there does “Continue ▸” become available.
  2. 2The button “▸ Try the path on a real record” and the sentence next to it: The button follows the path, read-only, on any record. It exists only in Dynamics.
  3. 3The field in the row “The path”: This text later goes on the button as the last parameter; here with the answer neueste at the end.
  4. 4“Copy” puts the text on the clipboard.
ElementWhat it does
Blue box “✓ The path leads to the target: primary source” Appears when the path has arrived at the template’s table and no question is open any more. Text, in substance: When clicked, the button reads its way from the button’s table to here and then prints the record it finds; use the breadcrumbs to go back if you want a different path. Tree and search box disappear. “Continue ▸” becomes available only when this box is there. What is printed later is the record at the end of the path, not the one on which the button was pressed.
“▸ Try the path on a real record” Next to it it says “Takes any »table« record and follows the path.” The button exists only in Dynamics. On click it is disabled, and next to it “Trying it out …” appears. The assistant reads the first record delivered of the button’s table and follows the path read-only, with the same evaluation as the real button. Results: green “✓ The path works: it ends at »table« ID.”; orange the sentence of the button, plus “for this record the path does not lead to the target. Perhaps a different relationship is the right one, or this particular record has it empty.”; or “There is not a single »table« record in this environment — so the path cannot be tried out.” Only one record is checked; a warning does not necessarily mean that the path is wrong. If the button library cannot be loaded, the test reports that and asks whether the library is published in this environment.
Copy line “The path” Note: “This is exactly what the button carries later as a parameter.” The path appears as text that you later enter in the command designer. A lookup (N:1) appears as field>table, a collection (1:N) as field<table:key:choice; several levels are separated by commas. In the instructions (Adding, changing and removing a button: The steps for creating a button), the same text returns in the step “Add the path as the last parameter”; after it, only the parameter with flow: may follow.

When the path does not reach the target

  • Four levels have been reached and the target is not among them: An orange box advises going back and trying a different relationship, because going further rarely helps and a different one usually gets there faster. Tree and search box then disappear. This is not a hard maximum depth: a single click in the tree can accept several levels at once and end at the target, and then a path with more than four levels is also done.
  • No relationship leads on from the table: An orange box says that not a single relationship leads on from the table and advises going back above and trying a different one. This appears if Dynamics delivers no relationship for the current table.

Place, several rows and purpose

Where in “Table”?

This is about Dynamics, not about Power Apps: where should the button later appear for your users? It is created only in the last step, in Power Apps. Each card shows a small sketch of the Dynamics view; the pink button sits where it would end up.

The window “Manage buttons in Dynamics” in the step “Where in »Rechnung«?”. Under a short explanatory text are four cards one below the other, each with a small sketch on the left and the title and a description on the right. The first card “Main form” is selected (blue border, light blue background, filled dot); its sketch shows a form with a pink button in its gray bar at the top. The sketch of the card “Main grid” shows a list with rows and checkboxes; the pink button is in the bar above the list. For “Subgrid view”, a small bordered list lies in the middle of a form, and the pink button sits in its own small bar. For “Associated view”, the sketch shows a tab bar with a tab marked blue and below it a list with the pink button. The footer bar shows “Step 4 of 7”, “Back” and a blue “Continue ▸”.
The four places where a button can be in Dynamics. The pink button in the sketch shows where it ends up.
  1. 1“Main form”: The button is at the top, in the bar of the open record.
  2. 2“Main grid”: The button is above the whole list; here the user has to check a row first.
  3. 3“Subgrid view”: The button belongs to the small bar of the list in the form, not to the large bar at the top.
  4. 4“Associated view”: the list in the “Related” tab; in the sketch the tab is marked blue.
CardWhat the user has in front of themDefault
“Main form” Exactly one record, the open one. The button is at the very top of the bar, next to “Save” and “Delete”. This is the most common case and the one to start with: what is to be printed is unambiguous, it is the open record. preselected; “Continue ▸” is available at once
“Main grid” The table’s list as a whole page. The button is above the list, in the same bar as “New” and “Delete”. Here it has no record open: the user has to check a row first, otherwise the button does not know what to build the document for. –
“Subgrid view” The records appear as a small list in the middle of the form of another record, for example all documents of an account at the bottom of its page. The button belongs to the small bar of this list, not to the large one at the top. Here too, rows are checked. –
“Associated view” Almost like the subgrid, just one level further: on the “Related” tab, where Dynamics shows the connected records as a full list. If you miss the button in the subgrid, you will usually find it here. Here too, rows are checked. –

The place goes into the link to the command designer. It also decides whether the step “Several rows” appears (for the three list places), whether the three instruction steps for visibility appear (likewise for the three list places) and which first parameter is to be entered: in the subgrid view and the associated view it is SelectedControl, otherwise PrimaryControl.

Caution

With PrimaryControl, the button in the subgrid and in the associated view would get the form around it and would work for the record on whose page the list sits, instead of for the checked rows. If this record belongs to the same table as the template, its document is silently created, without any message. Otherwise the button warns that template and record do not fit together and that the document stays empty or shows something wrong; for the email purposes and with a path it cancels, and no email is then created. Check the first parameter in the command designer.

Does it matter what the user checks?

This step appears only at the three list places. The explanatory text says: In a list, the user can check several rows and then click the button. What should happen then? This does not change the document itself: for four records, exactly the same thing happens four times as for one.

CardWhat it doesDefault
“Exactly one record” “The button works for the one checked row. If several are checked, it stops and says so — better nothing than the wrong document. This is the previous behavior and the safe choice as long as nobody has asked for anything else.” The entry in the field “Function” gets no addition. The visibility formula in the instructions is CountRows(Self.Selected.AllItems) = 1. preselected
“All checked rows, one after the other” “If the user checks four rows, four documents are created — one after the other. At the end it says what succeeded; anything that goes wrong does not stop the others.” The entry in the field “Function” then ends in All. A flow on the button runs per record. The visibility formula is CountRows(Self.Selected.AllItems) > 0. Two note boxes appear below. –

Instead of an additional parameter, there is an entry of its own in the field “Function” for “all checked rows”, because the command designer takes parameters as text and a typo would otherwise go unnoticed. The eight entries are listed in What happens on click: The eight entries for the field “Function”.

The two boxes for “All checked rows”

  • Blue box on the limits. If you have not yet seen the Purpose step, it says what applies depending on the purpose: when displaying, all documents end up one below the other in a single tab, because the browser allows only one new window per click and silently blocks every further one; with “Prepare an email and present it”, no draft opens with several rows, all the drafts are created, and at the end it says where they are; with “Send email immediately”, every email goes out without a prompt, and at the end it says how many were sent. The box also names the limit of 200 rows when displaying and that it does not apply to emails. What happens beyond it is described under What happens on click: The limit of 200 rows. After the Purpose step, it says only what applies to the chosen purpose. Strictly speaking, the sentence about the email drafts applies only if more than one row is checked: with exactly one, the draft opens as with a single record. After the purpose “Send email immediately”, it says: “With several records, every email is sent immediately, one after the other — without asking and without a draft. At the end it says how many were sent and what did not succeed; the sent emails are on each record’s timeline.” After the purpose “Download e-invoice”, it says: “With several records, one e-invoice is created per record, one after the other. They all come together as ONE ZIP file — the browser would not allow many individual downloads. Anything that fails does not stop the others, and at the end it says what is missing.” If the template has a switched-on e-invoice and you have not yet seen the Purpose step, the blue box additionally says: “With »Download e-invoice«, the e-invoices of all checked rows come together as ONE ZIP file.” The limit of 200 rows does not apply to this purpose.
  • Orange box on the visibility rule. In substance: A visibility rule goes with this. As long as nothing is checked, the button should not be clickable. You do not have to program anything for this, the command designer has it built in; the last step shows where. The three instruction steps for visibility appear at all list places, also with “Exactly one record”.

What should the button do?

The explanatory text says: All three create the same document from this template; they differ only in what happens with it afterward. If the template has a switched-on e-invoice, it says instead: The first three create the same document from this template, the fourth delivers only the e-invoice of this template, as an XML file. Once this step has been shown, the preselected card also counts as an answer; from then on, the step “Several rows” shows the matching note text. Which entry in the field “Function” belongs to which card, in each case one for one record and one for all checked rows, is described under What happens on click: The eight entries for the field “Function”.

The window “Manage buttons in Dynamics” in the step “What should the button do?”. Three cards are one below the other: “Create and display the document” with the icon of a sheet with a red PDF label, “Prepare an email and present it” with a pale envelope and “Send email immediately” with an envelope with a blue arrow pointing up. The third is selected (blue border, light blue background); its text says that the button takes the recipient from the record, from a lookup such as the customer or from an email field, and that you choose this in the next step. The footer bar shows “Step 5 of 9”, “Back” and a blue “Continue”.
The three purposes, here with “Send email immediately” for a template for an invoice.
  1. 1Each purpose has its own drawn icon: a sheet with a PDF label, an envelope, an envelope with an arrow.
  2. 2The text of the third card: The button takes the recipient from the record. Where exactly from, you choose in the next step, Who receives the email?
CardWhat it doesDefault
“Create and display the document” “One click — the document is built and opens in a new tab. From there you can view it, save it or actually print it. Nothing is stored in Dynamics and nothing is sent.” The finished PDF opens in the tab and is stored nowhere. No email template step follows. If the template has a switched-on e-invoice, the card appends a sentence saying what this button delivers for this template: for “e-invoice only (XML)”: “⚠ This template delivers its e-invoice as an XML file: the button offers it for saving. No PDF is created; the tab that opens on the click closes again right away.” (with a reading copy instead of the last sentence: “… and also shows the PDF as a reading copy in a new tab.”); for ZUGFeRD with an embedded PDF: “With this template, the PDF itself is the e-invoice (ZUGFeRD: PDF/A-3 with embedded XML).”; for a standard of your own whose output the template does not determine: “This template has an e-invoice: depending on the setting, it is embedded in the PDF, or the button offers it as an XML file for saving.” preselected
“Prepare an email and present it” “The document is built, an email is created from it and opened with the document attached. It is not sent — the user does that themselves after looking at it.” The document is attached to the draft as a PDF; attachments of the email template are copied along. After that follow the steps Who receives the email? and Email template. If you choose a lookup or an email field under Who, this recipient is in the draft. Otherwise the record itself is in the draft if it is a recipient (contact, account, lead, user, queue), and for any other table the draft is created without a recipient; the user enters it there. –
“Send email immediately” “The same, but the email is sent without confirmation. The button takes the recipient from the record: from a lookup such as the customer or from an email field — you choose this in the next step. If the template prints a contact, an account, a lead, a user or a queue, the email can also go to the record itself. Without a recipient the action stops instead of sending into the void.” After that follow the steps Who receives the email? and Email template. –
“Download e-invoice” “One click — this template’s e-invoice is created as an XML file and offered for saving; for ZUGFeRD, it is the XML that is otherwise embedded in the PDF. It is checked as when printing: if a value is missing, no file is created, and the button says what is missing. No PDF is created, and nothing is stored in Dynamics.” The card is available only if the template has a switched-on e-invoice. If the template has a condition under “Only if …”, the card adds: “⚠ This template only creates the e-invoice if its condition »Only if …« is met. If it is not met for a record, no file is created, and the button says so.” The instructions follow right after: the steps Who, Email template and Flow do not exist for this purpose. –

When “Send email immediately” works: You can choose this purpose for any template. Whether it can succeed is decided by the next step, Who receives the email?. If the template prints a contact (contact), account (account), user (systemuser), queue (queue) or lead (lead), the email goes to the record itself even without a choice. For any other table, the step needs a lookup or an email field; otherwise “Continue ▸” stays disabled. What is checked is the table of the template’s primary source, not the table on which the button sits.

When “Download e-invoice” is available: only if the template has the e-invoice switched on on the “E-invoice” tab of the template settings (see E-invoice: Switching on and “Only if …”). If you switch it off afterward, a chosen purpose falls back to “Create and display the document”. The card depends on the state of the open template; the finished button, by contrast, reads the saved template on click (see Adding, changing and removing a button: The steps for creating a button, step “Save the template — otherwise the button does not know the e-invoice”).

The window “Manage buttons in Dynamics” in the step “What should the button do?” for a template with an e-invoice. Under the question is an explanatory text: The first three create the same document, the fourth delivers only the e-invoice as an XML file. Four cards are one below the other. “Create and display the document” is chosen (blue border) and carries, at the end, the note that this template delivers its e-invoice as an XML file, that no PDF is created and that the tab that opens on the click closes again right away. Next come “Prepare an email and present it”, “Send email immediately” and, with a green icon “XML”, “Download e-invoice”. At the bottom “Step 5 of 7”, “Back” and the blue button “Continue”.
The Purpose step for a template with an e-invoice: four cards instead of three.
  1. 1The fourth card appears only if the template has a switched-on e-invoice.
  2. 2The card “Create and display the document” says what this button delivers for this template.
  3. 3The explanatory text names the difference of the fourth card.

Who receives the email?

This step appears only for the two email purposes, directly after the purpose. The explanatory text says: The button can pass along the recipient from the record for which the document is created, from a lookup such as the customer or from an email field. It reads it on click from exactly the record that the template prints. If the button sits on a different table than the template, that is the record at the end of the path. The choices are therefore the fields of the table of the primary source, not those of the table on which the button sits.

The window “Manage buttons in Dynamics” in the step “Who receives the email?”. Under the explanatory text are three cards: “As before — the button supplies no recipient” with the sentence that this does not work for “Send email immediately” here, because the template prints no contact, no account, no lead, no user and no queue; “From a lookup of the record” (selected, blue border) and “From an email field of the record”. Below it the label “Lookup” and a selection list with “Kunde (customerid) → account, contact”, below it a note with a warning triangle: “If the field is empty on a record, the button sends nothing for it and says so — it does not guess another recipient.” The footer bar shows “Step 6 of 9”, “Back” and a blue “Continue”.
The step for a template for an invoice, with the lookup to the customer.
  1. 1“As before”: The button supplies no recipient. With “Send email immediately”, that works only if the template itself prints a contact, an account, a lead, a user or a queue; not here, hence the sentence in the card.
  2. 2“From a lookup of the record”: for example the customer or a contact person.
  3. 3“From an email field of the record”: a text field in email format.
  4. 4The list of suitable lookups: display name, logical name in parentheses, and after it the tables the lookup points to.
CardWhat it doesDefault
“As before — the button supplies no recipient” (—) The button supplies no recipient. The text of the card says what then happens. If the template prints a contact, an account, a lead, a user or a queue, it says: “The email goes to the record itself — … and that is a recipient itself.” For any other table, with the purpose “Prepare an email and present it” it says: “The draft opens without a recipient, and the user enters it there.” With the purpose “Send email immediately” it says: “Does not work for »Send email immediately« here: the template prints no contact, account, lead, user or queue — the record is not a recipient itself, and without a recipient the button sends nothing.” Every button without the parameter to: behaves this way too, including all that already exist. preselected
“From a lookup of the record” (↗) “For example the customer or a contact person. The lookup must point to a contact, an account, a lead, a user or a queue; the email goes to its email address.” Below it appear a dividing line and the selection list “Lookup”. –
“From an email field of the record” (@) “A text field in email format. The email goes to the address it contains; several addresses separated by semicolons work too.” Below it appear a dividing line and the selection list “Email field”. –

The button carries the choice as a further parameter with the beginning to:, for a lookup for example to:_customerid_value, for an email field for example to:emailaddress1. The instructions at the end name it for copying (see Adding, changing and removing a button: The steps for creating a button).

The selection list

SettingWhat it doesDefault
“Lookup” (label on the left) Chooses the lookup. Entries: “— please choose —” and, for each lookup, the display name, in parentheses the logical name and after an arrow the tables that the lookup can point to. A lookup is offered as soon as it can point to at least one of the five tables contact, account, lead, user or queue. “— please choose —”
“Email field” (label on the left) Chooses the text field. Entries: “— please choose —” and, for each field, the display name with the logical name in parentheses. The text fields in email format are offered. “— please choose —”

The names in the list come from Dynamics; they are data and stay untranslated in the English interface. If you switch the card, the choice in the list is empty again. As long as the list is at “— please choose —”, “Continue ▸” stays disabled (see The orange line).

Notes below the selection

NoteWhen and what it says
“Lookup” can also point to “table”. … Orange. Appears below the selection if the chosen lookup can point not only to contact, account, lead, user or queue but also to a table that is not a recipient itself. The table appears with its logical name, for example “team”. It continues: “If it points there on a record, that is not a recipient: »Send email immediately« then sends nothing and says so, and a draft opens without a recipient.”
If the field is empty on a record, … Appears below every filled list, even before you have chosen anything. With the purpose “Send email immediately”, orange: “⚠ If the field is empty on a record, the button sends nothing for it and says so — it does not guess another recipient.” With the purpose “Prepare an email and present it”, gray: “If the field is empty on a record, the draft opens without a recipient as before; the user enters it there.” What the user sees on click is described under What happens on click: When the button cancels.

If the list is empty or does not load

If the table has nothing to choose, an orange box appears: “»Table« has no lookup to a contact, an account, a lead, a user or a queue.” or “»Table« has no text field in email format.” You get no further with this card; choose a different one. In the case of a loading error, “The fields of the template’s table could not be fetched: …” appears instead, with the reason and the button “↻ Try again” (see Loading and errors).

Email template: always the same or depending on a condition

This step appears only for the two email purposes. It determines which email template from Dynamics supplies the subject, text and attachments. The explanatory text says: It supplies the subject, text and its attachments, and the attachments are copied into every email. Two kinds are offered: email templates that are built for the table of the primary source (the text names the table’s logical name), and email templates of the type “User”, which apply to every record. An email template of a foreign table is not available for choosing, because it would silently fill its placeholders with nothing. This also applies to the email templates of the cases and of the otherwise branch.

The assistant fetches at most 250 email templates, sorted by title, and does not say so if there are more. If there is neither a template for the table nor one of the type “User”, an orange box appears: create one in Dynamics, under Settings → Templates → Email Templates. The cards are then missing, and “Continue ▸” stays disabled.

CardWhat it doesDefault
“Always the same template” (✉) “One button, one template. The simple and more common case.” Below it are a dividing line and the selection list “Email template”. The button gets the email template’s ID as its third parameter. This choice does not delete cases of the template that are already saved. On click, the cases are evaluated anyway, and their warnings can appear. The email template, however, is determined by the parameter on the button; the note about this appears only together with a warning, so users usually do not see it. preselected as long as the open template contains no if-then cases and no otherwise value, not even unsaved ones
“Depending on a condition” (⑂) “For example: »if the order type is Project, use this template«. The button decides when clicked, based on the record’s data.” Below it follow a note about the fields, the case cards, “Add case” and the otherwise branch. The button gets no parameter for the email template in this case; it reads the cases from the saved template on click. preselected if the open template already contains cases or an otherwise value

The selection list “Email template”

It appears with “Always the same template”, with the label on the left. The list is based on the template’s primary source, not on the button’s table. The names of the email templates are data.

EntryWhat it meansDefault
“— please choose —”No choice yet; “Continue ▸” is disabled.preselected
Group “Built for »Table«”The email templates that are built for the table of the primary source (with the logical name of the table). The two group headings appear only if both kinds exist; otherwise a flat list appears.–
Group “Template type »User« — applies to every record”Templates of the type “User” that apply to every record.–
“⚠ Not in the list — ID ID”A substitute row for an ID that is already set in the template but is not in the list because the email template was deleted, is built for a different table or lies beyond the first 250. It occurs only in the lists “Then this email template” and “Otherwise — if no case applies”, not with “Always the same template”. It stays visible and selected as long as you choose nothing else. If you choose something else, it disappears and does not come back. The tooltip says: This email template is set, but it is neither among those for the table nor among those of type “User”, probably deleted or built for a different table. If so, the button stops with a message when sending; please choose one from the list.–

Depending on a condition: the cases

With “Depending on a condition” you create if-then cases: if a condition applies, a particular email template applies. The first matching case wins; after that, the search does not continue. The number of a case therefore has a meaning.

The window “Manage buttons in Dynamics” in the step “Which email template?”. At the top two cards: “Always the same template” with an envelope (not selected) and “Depending on a condition” with a branching icon (selected, blue border). Below it is a note with a gray edge line saying that the 5 fields that the template uses from “Rechnung” are available. Next comes a bordered card “Case 1” with a pale up-arrow button and a button with ✕ at the top right. In it, under “If”, is a builder with the switches “AND” (active, blue) and “OR”, an info icon, a condition row with the field “Bezahlt” and the comparison “is no” and the buttons “Condition” and “Subgroup”. Under “Then this email template” is a selection list with “Zahlungserinnerung”. Under the case card is the button “Add case”, below it a card with a dashed border, “Otherwise — if no case applies”, with the sentence that the button stops without this entry and a selection list with “Rechnung versenden”. The footer bar shows “Step 7 of 9”, “Back” and a blue “Continue ▸”.
If-then cases for the email template: one case and the otherwise branch. The first matching case wins.
  1. 1The note with a gray edge line: Only fields that the template uses are available.
  2. 2The buttons “↑” and “✕” in the head of the case: “↑” moves the case up (for the first case it is grayed out), “✕” deletes it at once and without a prompt.
  3. 3The builder under “If”: the same as for the visibility rules, only with the fields of the template.
  4. 4The selection list under “Then this email template”: the email template that applies if the condition applies.
  5. 5“Add case” appends a new, empty case; it is saved only once it is complete.
  6. 6The dashed otherwise branch: the fallback if no case applies. Without it, the button then stops.
ElementWhat it doesDefault
Note on the fields With fields, a note with a gray edge line appears: The fields that this template uses from the primary source are available. If you need another one, add it on the left under “Data”; a field that the template does not know is not even fetched when printing, and the condition would then never apply. If the template does not yet use any fields in its primary source, an orange box appears: There is nothing a condition could judge; add fields on the left under “Data”. Then cases, “Add case” and the otherwise branch are missing entirely. –
Case card (case n) A card with a header row, the builder “If” and the selection “Then this email template”. A case is written into the template only once condition and email template are set. A half-finished case lives only in the window and is gone when you close it. It is written at once into the open template; there is no save path of its own. A case without “Then” is also skipped when printing, and a case that cannot be evaluated is skipped with a warning. –
“↑” in the case card Tooltip: “Move up — the first matching case wins”. Moves the case up one place and writes the new order into the template at once. For the first case the button is grayed out. There is no button for moving down. –
“✕” in the case card Tooltip: “Remove this case”. Deletes the case at once and without a prompt, also from the template. –
Builder “If” It is the builder of the visibility rules (see Conditions: The builder), here with three restrictions: “Choose field …” opens “Choose a field of this row” only with the fields of the template’s primary source, without relationships and without rules; the head reads “Row from »primary source«”, the note “Only the fields this template uses are checked — the same ones the document uses.” The switch “123” / “ƒx” does not exist here; comparison is always with a fixed value (see Conditions: Fixed value or value from the data: “123” and “ƒx”). Your own variables do not exist in the field picker (see Data tree and field picker: The field picker). A new case begins with an AND group and an empty condition row. The ⓘ explains AND, OR and subgroups as everywhere in the builder (see Conditions: AND, OR and subgroups). –
Box “Written by hand — and this is the condition that applies: …” If the template contains a hand-written condition that the condition parts cannot represent exactly like this, the card shows it in this box above empty condition parts. It applies unchanged until you fill the condition parts; then these replace it. Merely opening changes nothing. More under Conditions: Hand-written conditions. –
“Then this email template” The selection list is the same as “Email template”: the email template that applies if the condition of this case applies. Every choice is written into the template at once, provided the case is complete. “— please choose —”
“Add case” Button below the case cards. Appends a new, empty case at the bottom. It is saved only once it is complete. –
“Otherwise — if no case applies” Card with a dashed border and the selection list of email templates: the fallback that applies if no case applies. Text: Without this entry, the button stops if no case applies; it would rather send nothing than the wrong thing. The otherwise branch also works alone: an otherwise value without a single case is enough for “Continue ▸” to become available. The choice is written into the template at once. “— please choose —”

Caution

The cases belong to the template, not to the button. After creating or changing a case, they are in the open template as an unsaved change. Then save the template with “Save”, otherwise the button does not know them. The instruction step “Save the template — otherwise the button does not know the cases” reminds you of this (see Adding, changing and removing a button: The steps for creating a button).

The cases do not affect the document. They are evaluated after the document is built, against the same data that the visibility rules see; with a path, that is the data of the record at the end of the path. If a field name is misspelled, the button reports on click a warning that case n checks a field that is not in the record’s data. If in the end neither a case nor an otherwise branch determines an email template, and the button carries none either, the action cancels. Which email templates are available for choosing is described under Email template: always the same or depending on a condition. Where else conditions occur is described under Conditions: Where conditions occur.

The step “Should a Power Automate flow run afterwards?”

The explanatory text says: A cloud flow (Power Automate) can carry on afterward, for example filing the document in SharePoint, starting an approval or notifying Teams. The button starts it as soon as the email is ready, with the purpose “Create and display the document” as soon as the document is ready; nobody has to wait for it. For the purpose “Download e-invoice”, this step is omitted: the action behind it, st_GenerateEInvoice, has no input for a flow, and the instructions contain no step for it.

The window “Manage buttons in Dynamics” in the step “Should a Power Automate flow run afterwards?”. Under the explanatory text are two cards: “No, no flow” with a dash as an icon (not selected) and “Yes, start this flow” with a circular arrow (selected, blue border). After a dividing line, on the left is the label “Flow” and next to it a selection list with the selected entry “Smart Templates – Rechnung · via a document request”. Below it a gray note that begins with “Yours is not there?” and says that only flows from a solution are listed here, below it the blue button “Create flow …” with a flow symbol. Below the button, a gray paragraph explains that “Smart Templates – Rechnung” is started through a document request and its step “Hauptdatensatz holen” is set to “invoices” as a fixed value. The footer bar shows “Step 8 of 9”, “Back” and a blue “Continue ▸”.
The Flow step with a chosen flow. The state of a flow is in its name in the list.
  1. 1The chosen card “Yes, start this flow”: Only with this choice do the list and button appear; without a flow, “Continue ▸” stays disabled.
  2. 2The selection list next to “Flow”: The state is in the name, for example “(switched off)”, “· on the email” or “· via a document request”.
  3. 3The gray note “Yours is not there? …”: Only flows that are in a solution count.
  4. 4“Create flow …” opens the flow management over the assistant.
  5. 5The gray paragraph under the button explains what the chosen flow gets on click.
CardWhat it doesDefault
“No, no flow” (—) “The button does exactly what you chose above — nothing more.” Clears the flow choice. preselected
“Yes, start this flow” (↻) “The flow learns which record it was about and then carries on by itself.” Below it appear a dividing line, the flow selection, notes and “Create flow …”. The PDF itself is not passed to the flow: a flow on the table “Email” gets the created email with the document as an attachment, a flow on the table “Smart Templates Auslöser” fetches the document itself. Without a chosen flow, “Continue ▸” is disabled. –

The selection list “Flow”

SettingWhat it doesDefault
“Flow” (label on the left) Chooses the flow. Entries: “— please choose —” and, for each flow, the name, with an addition after the name depending on its situation: “(switched off)”; “· on the email” (the flow is attached to the table “Email”, in the list only for the email purposes); “· via a document request” (it listens to the table “Smart Templates Auslöser”; this holds for all flows created by the designer and for flows you built yourself on this table); “· table not recognizable” (neither Dynamics nor its trigger names a readable table). The state is in the name because flows that are switched off deliberately stay in the list. “— please choose —”

At most 250 cloud flows of the environment are read, sorted by name; those that come last alphabetically are therefore missing. If there are more, the following appears below the selection and its notes: “Only the first 250 cloud flows were loaded. If yours is not there, let us know — the limit can be raised.” If no flow is left after sorting out, this sentence is missing; a flow can then also be missing because it lies alphabetically after the first 250. Only flows that are in a solution count; what is under “My flows” does not exist in Dynamics and cannot be triggered. Create such a flow in a solution or add it to one (in Power Automate: Solutions → your solution → “Add existing” → Automation → Cloud flow). Not offered are:

  • the test flow “Smart Templates – Verbindungsprobe”,
  • flows that name no table in Dynamics and are not on-demand, so cannot be started from outside (they usually have the wrong trigger, see What happens on click: When the button cancels),
  • flows on the table “Smart Templates Auslöser” that do not listen to new rows,
  • flows on a different table than the template’s primary source,
  • with the purpose “Create and display the document”, also flows on the table “Email”,
  • flows created by the designer with a different fixed primary table.

A flow created by the designer carries its template’s table as a fixed value in the step “Hauptdatensatz holen” and is therefore offered only to templates with the same primary table. Flows without a fixed table are available for every template: flows you built yourself without this step and flows that were created for a template whose source carried no table name. If the source of the currently open template carries no table name, the assistant does not sort out by primary table at all. Then flows of a different fixed primary table are also available for choosing, and the note on the chosen flow advises choosing it only with the same primary table. If a flow’s definition cannot be read, it appears with a warning. On click, Smart Templates does not check this binding.

Notes below the selection

NoteWhen and what it says
Yours is not there? Only flows from a solution are listed here. … Appears below the selection. In substance it continues: What is under “My flows” does not exist in Dynamics at all and therefore cannot be triggered either (see The selection list “Flow”). You can also create a new one here. If needed, the number of flows via a document request that were created for a different primary table and are therefore not available for choosing follows, as does the sentence that flows you built yourself on “Smart Templates Auslöser” could not be read just now.
Note on the chosen flow Explains what the chosen flow gets on click and whether it will run. At most one box appears; the cases are in the list below this table, in the order in which they are checked.
Orange note for “all checked rows” Only at a list place with “All checked rows, one after the other” and a chosen flow: The flow runs per record, four checked rows result in four flow runs.
Green or orange box after creating Appears once, directly after a creation from this step. If a flow was created via “Create flow …” and it appears in the newly loaded list, it is selected, and a green box says: It was created and is selected below; you build what the flow should do in Power Automate, and the button also works as long as only the placeholder is in there; the reminder about the wait after switching on is added, with the same sentence as in “Manage flows” (wording and duration in the tip under Flows: Manage flows). If it is missing from the list, an orange box appears: The flow was created but does not appear yet; wait a moment, go back one step and forward again. It is not selected in this case: what is not listed here is not carried by the button either.
  1. Switched off (orange): The note warns that the button cancels with a flow that is switched off before anything is created (see What happens on click: When the button cancels). Switch the flow on in Power Automate. With a flow that is switched off, only this warning appears, even if it also runs via a document request.
  2. On the email: The flow is attached to the table “Email”. This is the most useful case: it gets the created email and thus the document as an attachment, without you having to pass anything along.
  3. Via a document request: On click, a request row is created, the flow listens for it and fetches the document itself. Depending on the flow, it says: With a fixed table, that its step “Hauptdatensatz holen” is set to the table name of this template’s primary table and it is therefore offered only for templates with the same primary table. Without a verifiable table name, the advice to choose it only with the same primary table. With free binding, that it carries no fixed table and therefore suits every template. With an unreadable definition, that it could not be read whether the step is set to a table.
  4. Table not recognizable (orange): The flow names no table in Dynamics. Smart Templates starts it anyway and passes the record of the template’s table; whether its trigger really listens to this table cannot be checked from here. Look in Power Automate before you choose it.
  5. Otherwise: The flow is passed the record of the table that the click was about.

If the list is empty or does not load

In the case of a loading error, “The flow list could not be fetched: …” appears, with the reason and the button “Create flow …”. If the list is empty, an orange box with several paragraphs and the same button appears. It names the reasons, as far as they apply:

  • Most often: The assistant sees only flows that are in a solution. A flow under “My flows” never appears here (see The selection list “Flow”).
  • One or more cloud flows name no table in Dynamics and are not on-demand, if applicable with the addition that flows you built yourself on “Smart Templates Auslöser” could not be read just now. Flows on this table that do not listen to new rows are likewise sorted out by the list; the box then names them with the same reason, which does not fit here.
  • One or more flows are attached to a different table than that of the template. You do not have to rebuild that: flows that the designer creates do not need a trigger on this table.
  • One or more flows via a document request were created for a different primary table and are therefore not available for choosing; create one of your own for this template.
  • The short way: the button “Create flow …” below. The flow is created there, switched on and fully wired, and it opens right away in Power Automate.
  • Only with the email purposes: A flow that is instead attached to the created email still works; it then gets the document as an attachment.

If you prefer to build the flow yourself (the long way), the assistant names the settings; they are listed, with the names from Power Automate and the necessary row filter, under Actions and APIs: Starting a flow.

The button “Create flow …”

The button is highlighted and carries a drawn symbol. Tooltip: “Opens the flow management. The flow is created here and opens in Power Automate right away — after that it is in this list.” It appears only with “Yes, start this flow” and is in all three situations: with a loading error, with an empty list and with a filled list, where it is indented. It opens the window Manage flows over the assistant, and every change there arrives here: after a creation, the flow list is fetched anew, and the new flow is selected as soon as it really appears in the new list. After a removal, the list is fetched anew and the selection in the assistant is cleared, whichever flow was removed; “Yes, start this flow” stays checked in that case, and “Continue ▸” is disabled until you have chosen a flow. After that, the content jumps to the top.

The last step: the instructions

The last step of all branches is called “Step by step”. It is the instructions for the command designer of Power Apps, with the link there, every value to copy and a recording for most steps. When creating, it has 13 to 20 steps, when changing and removing four. It has a page of its own: Adding, changing and removing a button. In the footer bar, “Continue ▸” is missing in this step, and “Close” ends the assistant (see The footer bar).

What the finished button does on click is described under What happens on click. The flows that the button can start you create under Flows.

What changes in the document?

On the canvas

Nothing. The two buttons and all settings in their windows change nothing on the sheet. The assistant writes the email template’s if-then cases into the template, not onto the sheet; they are an unsaved change until you press “Save” at the top.

In the PDF

No setting of the two windows changes the PDF. The email template’s if-then cases have no influence on the document, nor does the flow (see Flows: What changes in the document?). What the finished button prints and how it differs from the button “PDF” is described under What happens on click: What changes in the document?; it also says there that no document is created at all if the flow is switched off or removed at the time of the click.