Skip to main content
Add or subtract time from a date in your workflow. Use the no-code Calculate Datetime quick action for a single date. A custom integration still works if you need to calculate a batch of dates in one step.
Good to know: Check out our ready-made templates available when you add a step and select Templates > Next Matter templates. You can use the templates to create a set of pre-configured steps.

Calculate a date with a no-code step

  1. In your workflow editor, click + Add step.
  2. Select Integrations > Quick action.
  3. Click Configure.
  4. Click the Quick Action operation field and select Calculate Datetime.
  5. In Base datetime, choose Use Now or Today and pick Now or Today, or choose Enter datetime and enter a datetime (YYYY-MM-DD HH:MM:SS) or a data reference from a previous Date form field.
  6. In Calculation type, select Add or Subtract.
  7. In Time unit, select the unit to add or subtract, such as Day, Week, or Month.
  8. In Time to adjust, enter the amount, for example 5, or a data reference. For Date, Datetime, or Time units, enter a value in that format to compare with the base datetime.
  9. Select a Timezone. This applies to the base datetime and to datetime values in Time to adjust.
  10. Optionally select an Output format. You can also format a date data reference later.
  11. Optionally expand Advanced excluding configuration to skip weekends, holidays for a country, or custom days (YYYY-MM-DD,YYYY-MM-DD).
  12. To reuse the result in later steps, add Calculated Date in Response data for use in later steps. See Variables in workflows.
  13. Save your changes.
To skip Saturday and Sunday, expand Advanced excluding configuration and turn on Exclude weekends.

Calculate a date with a custom integration

Use a custom integration when you need to calculate more than one date in a single step.
  1. Open your workflow and create a form step with the two form fields. Click + Add form field and create the following:
    • Date: The date when you want to apply the calculation.
    • Short text: The number of days to add or subtract when running your workflow.
    To subtract days, enter a negative number such as -5. For adding days, type the number.
  2. Create an integration step after the form step.
  3. Click Settings to configure the step. Enter the following details:
  • Method: POST
  • URL: https://integrations.nextmatter.com/g/utils/calculatedate
  • Headers: Content-Type: application/json
  • Body might look like the following:
date: Enter the date by using the data reference of the date form field from the previous step.days_to_add: Number of days to add or remove. To remove, add a minus, for example, -5enable_business_days: Optional. If set to true, the calculation skips Saturday and Sunday. Adding 1 day to a Friday leads to the next Monday. This feature is not available when removing dates. It will return an error if days_to_add is negative, and enable_business_days is set to true.For example:
In reality, Body might look like the following:
Your batch might look like the following:
  • In the Results to be used in later steps, click Add variable. You need to create a variable for every date set so that the resulting date can be referenced in later steps.
    • For one date set, add the calculatedDate variable with the value of $.date
    • For multiple sets, your variables might be the following: