SmartDates
SmartFields give you the dates in your flow – a posting date, a due date, today. A SmartDate turns those into a calculated date, time, or date-time, dropped inline into any text field by wrapping it in [@ … @]. AutoFlow evaluates the expression, formats the result, and substitutes the whole [@ … @] block. (For pure number calculations, see SmartFormulas.)
The general shape is:
[@expression@]
[@expression;format@]
The optional ;format clause decides whether the result shows as a date, a time, or a date-time – see Formatting the result. Leave it off and you get the date in your local format.
Everything is calculated as a date-time: a date is taken at midnight, a time is taken on today's date. The format at the end decides what part you actually see, so you can feed a date into a time calculation and vice-versa without conversion.
Building a SmartDate
Anywhere a SmartDate is accepted, the assist-edit (…) opens the SmartDate builder. You start with a placeholder and either type a date, pick a SmartField, or add a function; each function becomes a pill with its parameters inline, and functions nest. A format row and a live Test panel let you preview the result with sample values before you save. You can also write the [@ … @] syntax by hand – the two are interchangeable.
Functions
Each function takes the date it works on as its first argument, so functions nest naturally.
| Function | Does | Example → |
|---|---|---|
dateadd(x, n, "unit") | add (or subtract, with a negative n) a number of units | [@dateadd({{invoice.postingDate}}, 1, "week")@] |
startof(x, "unit") | the first moment of the day, week, month, or year | [@startof({{today}}, "month")@] |
endof(x, "unit") | the last moment of the day, week, month, or year | [@endof({{today}}, "year")@] |
calc(x, "formula") | apply a Business Central date formula | [@calc({{today}}, "+1D")@] |
datediff(a, b, "unit") | the whole number of units between two dates | [@datediff({{dueDate}}, {{today}}, "day")@] |
year(x) / month(x) / day(x) / weekday(x) | a single part as a number (weekday: Monday = 1) | [@year({{today}})@] |
Units for dateadd are day, week, month, year, hour, and minute; startof, endof, and datediff use day, week, month, year.
calc takes a native BC date formula – the same short syntax you use in BC date fields, such as +1D (one day later), -1W (one week earlier), CM (end of the current month), or CY (end of the year). Both the English letters (D W M Y) and your session's letters (in German T W M J) are accepted.
Built-in dates
You can use today, now, and workdate directly in an expression without wrapping them as SmartFields:
[@startof(today, "month")@]
[@dateadd(now, -2, "hour")@]
Formatting the result
The part after the ; decides what the result looks like. Leave it empty for the date in your local format, or choose one of the built-in formats:
| Format | Shows | Example result |
|---|---|---|
| (omitted or empty) | the date in your local format | 24.08.2026 (German) |
@time@ | the time, hours and minutes | 14:30 |
@datetime@ | date and time in your local format | 24.08.2026 14:30:00 |
<Year4>-<Month,2>-<Day,2> | ISO date | 2026-08-24 |
<Hours24,2>:<Minutes,2>:<Seconds,2> | ISO time | 14:30:00 |
The builder offers these as one-click buttons (Date, Time, Date & time, ISO date, ISO time, ISO date & time). For anything else, the format is a standard BC format string – the same one you'd use for a SmartFormula – so you can shape the output however you need.
Numbers nest into SmartFormulas
datediff, year, month, day, and weekday return a number, so a SmartDate can sit inside a SmartFormula:
[[ [@datediff({{dueDate}}, {{today}}, "day")@] * 10 ]]
counts the days until the due date and multiplies by ten.
Examples
Due [@dateadd({{invoice.postingDate}}, 14, "day");<Year4>-<Month,2>-<Day,2>@]
A due date two weeks after posting, shown as an ISO date.
Reporting period: [@startof({{today}}, "month")@] – [@endof({{today}}, "month")@]
The first and last day of the current month.
[@calc({{contract.start}}, "1Y")@]
One year after the contract start, using a BC date formula.
Tips
- Pick the format to match what you want to see. Because everything is a date-time under the hood, the format – not the function – decides whether you get a date, a time, or both.
- Combine a base from several fields. The base of a SmartDate is a SmartText field, so you can piece a date together from literal text and SmartFields, for example
{{year}}-{{month}}-{{day}}. - Use the Test panel. It resolves the SmartFields to sample values (pre-filled with the current date-time) and shows the formatted result live, so you can confirm a nested expression before saving.
Where SmartDates show up
SmartDates can appear inline in any text-accepting field on a step configuration – descriptions, request bodies, log messages, parser inputs, and so on. Wherever a SmartField token ({{ … }}) is allowed, a SmartDate block ([@ … @]) is allowed too.