Macros in data flows
This guide will help you understand and use these macros effectively.
Check out the Coupler.io Macros Generator to optimize your flow.
What are Macros?
Macros allow you to dynamically insert date or date-time values in your data flow’s settings, which can help automate repetitive tasks or handle custom ranges that aren’t available in the preset dropdowns.
Macro's syntax
The general syntax for macros is:
{{macro}}
Supported date macros
The default date format is YYYY-MM-DD which corresponds to the ISO 8601 date standard
todayyesterdaytomorrowthisweekstartthiscan be replaced withlastornextweekcan be replaced withmonthorquarteroryearstartcan be replaced withend
weekagoweekcan be replaced withmonthorquarteroryear
2weeksago2weeksfromnow2can be replaced with any number up to 3 digitsweekscan be replaced withdaysormonthsorquartersoryears
Date macros usage examples
In the examples below, assume that today’s date is August 26th, 2026.
start_date: {{today}}
start_date: 2026-08-26
updated_at: {{thisweekstart}}
updated_at: 2026-08-24
to: {{3monthsago}}
to: 2026-05-26
to: {{1yearfromnow}}
to: 2027-08-26
Supported Date-time Macros
The default date and time format is YYYY-MM-DD[T]hh🇲🇲ss[Z] which corresponds to the ISO 8601 date.
nowthishourstartthiscan be replaced withlastornextstartcan be replaced withend
hourago2hoursago2can be replaced with any number up to 3 digits
1hourfromnow1can be replaced with any number up to 3 digits
Date-time macros usage examples
In the examples below, assume that today’s date and time is August 26th, 2026 - 14:05.
created_at: {{thishourstart}}
created_at: 2026-08-26T14:05:00Z
updated_since: {{5hoursago}}
updated_since: 2026-08-26T09:05:00z
created_at: {{3hoursfromnow}}
created_at: 2026-08-26T17:05:00z
Supported custom macros formats
You can format each macro as needed using the following syntax:
{{macro.format(output-format)}}
macro- specify the macro you needoutput-format- specify the format you want the macro to outputdddd- day of the week (e.g. Monday, Tuesday, Wednesday, etc.)DD- day of the month (1-31)MM- month (1-12)YYYY- year (e.g. 2026)hh- hour (0-24)mm- minute (0-59)
Custom macros format examples
In the examples below, assume that today's date and time is August 26th, 2026, at 13:23.
created_at:{{today.format(dddd)}}
created_at:Wednesday
created_at:{{5hoursago.format(hh:mm)}}
created_at:8:23
created_at:{{55hoursfromnow.format(YYYY-MM-DD)}}
created_at:2026-08-28
Created_at: 2monthsago.endof(month).format(YYYY-MM-DD)
Created_at: 2025-06-30
Where can you use Macros?
Date & date-time settings of data flow (source settings)
Report Period

Advanced settings

Date filters

Body/string/query settings of data flow that allow dynamic input (source settings)
JSON / CSV URL, URL query string, and Body fields of the JSON or CSV Client data flow.
QuickBooks "Where" field
QuickBooks reports the "Query parameters" field.
Xero "Where" field
BigQuery "SQL query" field
JIRA "JQL" field
Slack "Search query" field
Sheet name setting (destination settings)
If you need the data flow to send data to a new destination sheet on each run, you may apply a macro in the name of the destination sheet.
Last updated
Was this helpful?




