SmartFields
SmartFields are named placeholders you drop into a step configuration, and AutoFlow resolves them when the step runs. A token like {{customer.no}} reads the customer's number out of the flow's context just before the step runs; the step itself sees the resolved text. They are how a Decision compares values from an upstream step, how an Insert Record fills field values, how a Sleep step picks its duration, and how an HTTP Request composes a URL or body.
Two concepts cover most of what you need to know:
- A SmartField has a type. A value SmartField resolves to a piece of text (a name, a number, a date). A reference SmartField resolves to a record – useful for downstream steps that need to operate on the record itself, like Modify Record or Delete Record.
- References can be drilled into. Once you point a SmartField at a record, you can pick a field on that record (
{{customer.name}}), or – if that field also references another table – drill further ({{customer.salesperson.email}}). The picker walks the chain for you.
Where the SmartFields actually come from depends on the flow:
- The trigger registers SmartFields when it fires (a webhook trigger, for example, exposes the parsed payload).
- Each step registers its outputs as SmartFields under the step's name (
parser.amount,httpRequest.responseBody,findRecords.results). - The flow's own SmartField definitions (the Edit SmartFields dialog, see below) declare additional fields that are computed from the flow's records – typically reference SmartFields onto Business Central tables like Customer or Item.
The step slug
The step's name in {{slug_field}} is the step's slug – a short, lower-kebab identifier auto-generated from the step description when the step is first inserted (Send Email → send-email, then send-email-1 if the slug is already taken). The slug is purely an internal identifier; it never appears while the flow is running.
Each step's configuration page exposes the slug as a plain field directly under the step description, so you can rename it whenever the auto-generated name is awkward. The constraints are: no underscores (the parser splits on the first _), at most 15 characters, and it must be unique within the flow. When you rename a slug, every {{old-slug_*}} reference inside the flow definition is rewritten in place – downstream steps keep working without any manual fix-up.
This page walks through the two surfaces you use to manage and reference SmartFields:
- The Edit SmartFields dialog, opened from a flow card or version, where you author the flow's own SmartField definitions.
- The SmartField picker, opened with the assist-edit (...) button on any SmartField-friendly field on a step configuration page, where you pick an existing SmartField to insert into your input.
Built-in SmartFields
A handful of SmartFields are always available, in every flow, without registering anything. They show up in the picker alongside the trigger and step outputs:
| SmartField | Resolves to |
|---|---|
{{today}} | The current calendar date, as of the moment the step runs. |
{{workdate}} | The Business Central work date of the session that started the flow. It is captured when the flow is triggered and stays fixed for the whole run – so even though a flow usually runs a moment later in the background, {{workdate}} still reflects the work date the user (or schedule) had set when it kicked off. Subflows use the same captured value. |
{{currentDateTime}} | The current date and time, as of the moment the step runs. |
{{currentUser}} | A reference to the user record of the session running the flow. |
{{currentCompany}} | A reference to the Company Information record of the company the flow runs in. |
{{today}}, {{workdate}} and {{currentDateTime}} take the same ;<format> suffix as any other SmartField, so {{workdate;9}} renders the work date in ISO form (2026-08-04).
The difference between {{today}} and {{workdate}} matters when a flow posts or dates documents: {{today}} is always the real calendar date, while {{workdate}} follows the work date the user was working under – which is often a date in the past or future.
Edit SmartFields (from the flow card)
Open a flow and click Edit SmartFields in the action bar. The dialog is also available from a flow version page when you want to inspect the SmartFields stored on that specific version.
The action operates on the flow's draft version. If the flow is currently Published, AutoFlow first creates a draft from the published version and edits the draft – exactly the same convention as the flow editor itself. The published version stays untouched until you publish the draft.
What the dialog shows
The dialog opens on the SmartField Sets list. Each row is one Business Central table for which the flow defines SmartFields.
| Column | Meaning |
|---|---|
| Table No. | The underlying object id of the BC table. Hidden by default – use it if the table caption alone is ambiguous. |
| Caption | The table's caption, for example Customer or Sales Header. The drill-down opens the Set's card. |
| SmartFields | How many SmartFields are registered for this table. The drill-down opens the Set's card. |
To add a new Set, type into the empty row at the bottom of the list, pick a table from the assist-edit on the Table field, and save. The Set is created on the flow's draft definition; it is not stored anywhere outside the flow.
Inside a Set: SmartField definitions
Open a Set (drill-down on either the Caption or SmartFields column) to land on the SmartField Set card. The card has two parts:
- A General group at the top showing the table this Set is bound to.
- A SmartFields list part underneath, where each row is one SmartField definition.
For each definition you fill in:
- SmartField Name – the token name. This is what you write inside
{{ }}later. Names are scoped to the Set, so two different tables can both have anameSmartField without colliding. - Type – Value (resolves to a piece of text) or Reference (resolves to a record).
- Caption – read-only summary of what the field resolves to. Drill down on this column to pick:
- For a Value field: the BC field on the Set's table whose content the SmartField returns. The picker is the standard Fields Lookup.
- For a Reference field: the BC table that the SmartField points to, plus the filters used to look up the right record when the flow runs (see below).
Renaming a SmartField
You can rename a SmartField at any time, either in the SmartField Name column of the list or on the definition card. The rename carries everything attached to the definition with it: a Reference field keeps its filters, its key and its sort order, and every {{ }} placeholder that already uses the SmartField in the draft flow is rewritten to the new name for you. Nothing to clean up by hand.
Two things to know:
- A name that is already used by another SmartField on the same table is refused, so you cannot accidentally write over an existing definition. Pick a different name.
- In earlier versions, renaming in the list column could leave the old definition behind alongside the new one, with the filters stranded on the old name. If a reference in an existing flow has lost its filters after a rename, reopen the SmartFields page for that Set: you will see both rows, the leftover one still carrying the filters and the renamed one with none. Delete the leftover row and re-add the filters to the renamed field. Renames from this version onwards keep them.
The Format String column on a Value definition is optional and lets you control how the resolved value is rendered (BC's standard format strings – useful for dates and decimals).
Format suffix on a placeholder
You can also pin the format on a per-use basis without changing the definition. Append ;<format> to the placeholder:
{{order.posted;9}}– numeric short-form (9is BC's predefined ISO date/datetime format).{{order.posted;<Year4>-<Month,2>-<Day,2>}}– BC's text format strings, in full.
The inline suffix wins over the SmartField's per-definition Format String.
For binary SmartFields (BLOB, Media, MediaSet, Media Reference), three tokens are available:
| Suffix | What you get |
|---|---|
;base64 | The raw bytes as a base64 string. Also the default if you omit the suffix – {{invoice.attachment}} inside a JSON envelope renders as base64. |
;utf8 | The bytes interpreted as UTF-8 text. Use when the source field holds text bytes (a stored XML, JSON, or plain-text file). |
;utf16 | The bytes interpreted as UTF-16 text. |
Escaping values for XML / SOAP
When a value flows into an XML or SOAP payload, reserved characters such as &, < or > break the document. Three escape tokens turn the five reserved XML characters (&, <, >, ", ') into their entities, so a name like Meyer & Sohn arrives as Meyer & Sohn:
| Suffix | What you get |
|---|---|
;xmlEscape | The value, XML-escaped. For a binary (BLOB) field the bytes are read as UTF-8 first, then escaped. |
;utf8-xmlEscape | The same as ;xmlEscape. |
;utf16-xmlEscape | Like ;xmlEscape, but a binary (BLOB) field is read as UTF-16 before escaping. |
A SOAP body assembled from static text and SmartFields:
<Customer><Name>{{customer.name;xmlEscape}}</Name></Customer>
A few things to know:
- Token names are case-insensitive, so
{{customer.name;XMLESCAPE}}works too. - The encoding prefix only matters for BLOB fields – on a normal text field all three tokens simply escape the text.
- Use one escape token on its own; it replaces the value formatting rather than combining with it.
- As with any suffix, an inline
;xmlEscapewins over the field's Format String. You can also setxmlEscape(or autf8-/utf16-variant) as the Format String on the Value definition to escape that field everywhere it is used.
A bare {{field}} body on the HTTP Request step is special – see the HTTP Request page for raw-bytes upload mode.
Reference filters
A Reference SmartField does not just name a target table – it also has to describe which row of that table to return. You configure that on the Table Lookup card that opens when you drill the Caption column of a Reference field.
The card has:
- Ref. Table – the table the reference points to. Drill down to pick.
- Key – which key of the referenced table AutoFlow reads on. Optional; see Key and sort order below.
- Sort Order – Ascending or Descending. Decides which record the reference picks when several match.
- Filters – a list part where each row is one filter that narrows down the target table.
Each filter row has a Field (a column on the referenced table), a Lookup Type, and either a Lookup Text or a Lookup Field:
- Const – the filter value is the literal text in Lookup Text. Use this for fixed values:
Type = Item,Blocked = ''. - Field (the default) – the filter value is read from a field on the parent table (the Set's table) when the flow runs. The drill-down on Lookup Field picks that field.
- Filter – the filter value is a free-form filter expression in Lookup Text. Use this for ranges (
>=01.01.2026), wildcards (@ABC*), or any other BC filter syntax.
Together, these filters tell AutoFlow how to find the referenced record from the parent record when the flow runs – for example, "the Customer whose No. equals the Sales Header's Sell-to Customer No.".
Key and sort order
The filters decide which records match. Key and Sort Order decide how AutoFlow reads them.
By default a reference reads the target table on its primary key. That is exactly right when the reference points at one record by its primary key. But when your filters narrow the table by other fields – a document number, a customer number, a posting date – the read gets slower as the table grows. Set Key to the key whose first fields are the ones you filter on and the lookup stays fast however large the table gets. Use the assist-edit on the Key field to choose one; only the table's active keys are offered. The Use Primary Key action clears the choice again.
Sort Order matters as soon as the filters match more than one record:
- Ascending (the default) returns the first matching record in key order.
- Descending returns the last one.
That is how you express "the newest of these". Point a reference at Currency Exchange Rate, filter it on the currency, and set Sort Order to Descending – because that table is keyed by currency and then starting date, the reference resolves to the most recent rate.
Sort Order also sets the order in which a loop walks the records when you use the reference as the source of a ForEach Loop.
Leaving both untouched keeps the behaviour a reference has always had – primary key, ascending – so existing flows are unaffected. Changing the referenced table clears the key, because a key belongs to the table you picked it from.
Save
The dialog is modal: when you close it, the SmartField definitions are written back to the flow's draft version in one transaction. There is no separate Save button – closing is the commit. AutoFlow uses the new definitions the next time the draft runs.
The SmartField picker (from a step config page)
Many step configuration fields accept SmartFields – the URL on an HTTP Request, the input on a Parser, the condition on a Decision, the reference on a Modify or Delete Record, the duration on a Sleep, the message on an Error step, and so on. Every such field has an Insert SmartField button next to it, and it opens the SmartField picker.
The picker shows everything available at the position of the step: what the trigger and every upstream step have registered, plus the flow's own SmartField definitions for the tables those outputs reference.
The tree
The picker is a tree. The top level is the flow's own outputs, and every reference is expandable: expand it and you see the SmartFields the flow has registered on the table behind it. Everything starts closed, so you always begin with a short list. The first two levels are already loaded behind the scenes, which is why opening the first one is instant; deeper levels load as you expand them, so a long chain costs you nothing until you actually walk into it.
Each row shows the SmartField's name and, after it, what it is – Field: Name (2) for a value that maps to a BC field, Reference: Customer (18) for a reference. Value rows are shown in the same purple as the token you get when you insert them.
Type in the Filter box to narrow the tree down. Filtering searches the levels that are loaded and keeps the path to each match visible, so you can see where a hit sits. The filter clears itself once you pick something, so it never quietly narrows the next thing you look at.
Keyboard
The whole picker works from the keyboard, and you never need the mouse to reach it: from a configuration field, press Tab to get to its Insert SmartField button and Enter to open the picker.
Tab then walks everything the dialog shows, in reading order: a row, its own actions, the next row, and finally the confirm button. The arrow keys are the shortcut on top of that – ↓ and ↑ jump row to row from anywhere in the tree, including while you are standing on one of a row's action buttons.
The cursor starts in the filter box, because typing part of a name is usually the fastest way in:
| Key | In the filter box | On the tree |
|---|---|---|
| ↓ / ↑ | Move through the tree | Move through the tree |
| Space | Types a space | Open or close a reference |
| Enter | Take the highlighted SmartField | Take the highlighted SmartField |
| Ctrl+Enter (⌘+Enter on a Mac) | Confirm and close | Confirm and close |
| → | Moves the text cursor | Expand a reference, or step into it |
| ← | Moves the text cursor | Collapse a reference, or jump to its parent |
| Home / End | First / last row | First / last row |
| a letter | Types into the filter | Jumps to the next row starting with it |
| F2 | – | Edit the highlighted definition |
| Esc | Close without picking | Close without picking |
Picking a reference instead of a field
Sometimes you want the record, not a field on it – that is what the Reference input of a Modify Record, Delete Record or PDF Print step expects. Highlight the reference row itself and confirm; you do not have to expand it first.
Adding a SmartField while you are configuring
If the field you want is not registered yet, you do not have to leave the picker. Every reference row carries two small buttons on its right-hand side, + Field and + Reference, and they write to that reference's table:
When you open the picker scoped to one reference – which is what the panel's Add SmartFields does – the reference you are inside is shown as a header above the tree, and that header carries the same two buttons.
- + Field picks a BC field from the table and registers it under an automatic name.
- + Reference picks another table and opens the definition card so you can set up how the two are related.
Either way the picker comes straight back with your new SmartField highlighted, ready to insert – at any depth. A table with no SmartFields yet simply says so when you expand it; its row still has both actions, so that is where you start it off.
Value rows carry an Edit button instead, which opens the definition behind them (F2 does the same from the keyboard). Any of these buttons can be reached with Tab and pressed with Space or Enter. To register a brand-new table, use Edit SmartFields on the flow card.
Confirming a pick
Confirm with Enter, a double-click, Ctrl+Enter (⌘+Enter on a Mac), or the button at the bottom of the dialog. The SmartField box next to it always shows exactly what you are about to insert, wrapped in {{ }}.
Some inputs take only a reference, others only a value. Where that is the case, the rows you cannot use are greyed out, and the confirm button – and the shortcut – stay disabled while such a row is highlighted.
What the button does depends on where you opened the picker from:
- On a step configured in the flow editor's configuration form, it reads Select and writes the placeholder straight into the field you came from.
- On the older configuration pages it reads Copy & Close and puts the placeholder on the clipboard instead, so you can paste it (Ctrl+V) wherever you need it – including into the middle of longer text, without overwriting what is already there.
A handful of fields take a SmartField selector rather than a token – for example the For Each Loop's Selector, the Parser's record reference, or the PDF Print's Reference. The wire form is the same picker output ({{name}}) used everywhere else. The step's resolver decides whether to substitute the placeholder (for scalar values) or pass it through verbatim to the consuming step (for references, arrays and unresolvable names) – see the field's tooltip on the configuration card for the expected shape.
The SmartField panel
Wherever you write SmartFields, you can keep the whole tree open beside your work: the SmartFields panel on the left. It shows exactly what the picker shows, and it is there for one thing – dragging.
You get it when configuring a step in the flow editor, in the fullscreen text and code editors, and in the SmartFormula, SmartDate and SmartFilter builders. In the three builders it starts folded away, because those dialogs are narrower and already have their own Test pane on the right – open it with the chevron when you want it.
Pick up a row and drop it on the field you want it in:
- On a text field, the SmartField lands where you drop it, so you can place it in the middle of a sentence without disturbing what is already there.
- On a field that only takes one SmartField – a Reference, a record selector – the drop replaces whatever was in it.
- Fields that cannot take a SmartField never light up, so a drop that would not work is visible before you let go.
Everything that accepts a drop outlines itself while you drag over it. Drag towards the top or bottom edge of a long configuration form and it scrolls along with you.
The panel is a convenience for mouse work, not a second way of doing things: it is skipped when you tab through your fields, and the Insert SmartField button on each of them remains the way in from the keyboard.
Adding and editing definitions stays with the picker, and the panel takes you there in two places: the pencil in its header opens the picker, and every reference row has a plus that opens it already scoped to that reference – so what you create lands on the right table without you having to find it again. Either way, the panel refreshes with your new definitions when the picker closes.
Drag its right-hand edge to make the panel wider or narrower, double-click that edge to reset it, and use the chevron in its header to fold it away to a thin strip. Width and folded state are remembered for you, per user, across all of those surfaces. When a surface gets too narrow for both, the panel folds itself away so your actual work keeps the room.
When to use which surface
- You want to pick an existing SmartField for a step input → open the picker with the Insert SmartField button on that input, or drag it out of the SmartFields panel beside the form.
- You want to add or change the SmartFields the flow exposes for one of its tables → use Edit SmartFields on the flow card, or add the definition without leaving the picker via Select a field / Create a reference inside the table.
- You want to inspect or edit the SmartFields stored on a specific version → open the flow version and click Edit SmartFields. The dialog operates on that version directly – there is no draft-spawning here, so be deliberate when the version you opened is the published one.