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.
Our macros are converted to date/date-time using UTC+0 timezone so scheduling configuration and data timeframes must be planned accordingly.
Check the example
If the needed date-time value is not available among the options in the dropdown, you can manually specify it in these cases. You can instead type {{macro}} into the macro field, and the data flow will automatically interpolate it with your date-time value.

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
Tip: to get data dynamically starting at the start/end of some period, use the following custom macro format:
{{2monthsago.endof(month).format(YYYY-MM-DD)}}2can be replaced with any number up to 3 digitsmonthscan be replaced withdaysorweeksorquartersoryearsendofcan be replaced withstartofmonthcan be replaced withdayorweekorquarteroryear
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:mm: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)
Check the example
{{2monthsago.format(YYYY-MM-DD)}}2can be replaced with any number up to 3 digitsmonthscan be replaced withdaysorweeksorquartersoryears(YYYY-MM-SS)can be replaced with a combination of theoutput-formatexamples listed above like(MM-YYYY)
{{2monthsago.endof(month).format(YYYY-MM-DD)}}2can be replaced with any number up to 3 digitsmonthscan be replaced withdaysorweeksorquartersoryearsendofcan be replaced withstartofmonthcan be replaced withdayorweekorquarteroryear
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

HubSpot: Only date macros are available for HubSpot date fields. Date and time macros ( {{hourago}}, etc.) are unavailable.
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
QB requires the use of macro values in single quotes, i.e., '{{today}}'. Please find a more detailed guide for this here.
QuickBooks reports the "Query parameters" field.
Xero "Where" field
Special formatting to be used with Xero data flow: check the details here.
BigQuery "SQL query" field
JIRA "JQL" field
Slack "Search query" field
Examples of using macros in the URL Query Parameter and Request body for GET & POST Requests
"URL query parameter" field for GET requests

“Request body" field for POST requests
The output you would see in Slack:

To post a message to Slack:

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?
