Macros in data flows

This guide will help you understand and use these macros effectively.

Check out the Coupler.io Macros Generatorarrow-up-right 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.

circle-exclamation
chevron-rightCheck the examplehashtag

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 8601arrow-up-right date standard

  • today

  • yesterday

  • tomorrow

  • thisweekstart

    • this can be replaced with last or next

    • week can be replaced with month or quarter or year

    • start can be replaced with end

  • weekago

    • week can be replaced with month or quarter or year

  • 2weeksago

  • 2weeksfromnow

    • 2 can be replaced with any number up to 3 digits

    • weeks can be replaced with days or months or quarters or years

circle-check

Date macros usage examples

In the examples below, assume that today’s date is August 26th, 2026.

Parameter + macro
Parameter + Output

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 8601arrow-up-right date.

  • now

  • thishourstart

    • this can be replaced with last or next

    • start can be replaced with end

  • hourago

  • 2hoursago

    • 2 can be replaced with any number up to 3 digits

  • 1hourfromnow

    • 1 can 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.

Parameter + macro
Output

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 need

  • output-format - specify the format you want the macro to output

    • dddd - 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)

chevron-rightCheck the examplehashtag
  • {{2monthsago.format(YYYY-MM-DD)}}

    • 2 can be replaced with any number up to 3 digits

    • months can be replaced with days or weeks or quarters or years

    • (YYYY-MM-SS) can be replaced with a combination of the output-format examples listed above like (MM-YYYY)

  • {{2monthsago.endof(month).format(YYYY-MM-DD)}}

    • 2 can be replaced with any number up to 3 digits

    • months can be replaced with days or weeks or quarters or years

    • endof can be replaced with startof

    • month can be replaced with day or week or quarter or year

Custom macros format examples

In the examples below, assume that today's date and time is August 26th, 2026, at 13:23.

Parameter + Macros:
Parameter + Output:

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?

  1. Date & date-time settings of data flow (source settings)

Setting
Wizard

Report Period

Advanced settings

Date filters

circle-info

HubSpot: Only date macros are available for HubSpot date fields. Date and time macros ( {{hourago}}, etc.) are unavailable.

  1. 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

circle-info

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

circle-info

Special formatting to be used with Xero data flow: check the details here.

  • BigQuery "SQL query" field

  • JIRA "JQL" field

  • Slack "Search query" field

chevron-rightExamples of using macros in the URL Query Parameter and Request body for GET & POST Requestshashtag

"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:

  1. 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?