The "Calculate Days Between Two Date-Times" action from the Workflow Calculations app by Integration Glue is designed to calculate the number of days (whole or partial) between two specified date-time values. This action is particularly useful for automating workflows that require precise date comparisons or duration calculations.
A workflow might use this action to calculate how many days have passed since a deal was created and then trigger a task if the duration exceeds a certain threshold, ensuring timely follow-up.
Date & Time to Start From is where you select the date-time property that will serve as the starting point for the calculation (e.g., Deal Created Date, Last Contacted Date). Workflow uses this property’s value as the starting input for the date-time action you are configuring
Date & Time to End At is where you select the date-time property that represents the endpoint of the calculation (e.g., Deal Close Date, Next Activity Date). Workflow uses this property’s value as the ending input for the date-time action you are configuring)
Property to Set is where you need to to pick a number-type property where the result (the total number of days or hours between the two date-times) will be stored for further use. Defines the target property where the result of the calculated action will be stored (Shown on your corresponding workflow object)
The Calculate Days Between Two Date-Times action in HubSpot workflows calculates the number of days between two specified date-time properties. Here’s a step-by-step guide to set it up:
Step 1: Open the Workflow Editor
- Log in to your HubSpot account.
- Navigate to Automation > Workflows.
- Open an existing workflow or create a new one by clicking the Create workflow button.
Step 2: Add an Action
- After creating your custom properties and selecting your triggers, click the + button to add an action.
*If you don't know how to create custom properties click here - On the action side bar drop down, scroll down and look for the Workflow Calculation Actions App
- A drop down list of actions will appear. Select the "Calculate Days Between Two Date-Times" action
- Click Save to add the action to your workflow
Step 3: Configure the Calculation
Select the two date-time properties:
- Click on the property Date & Time to Start From field.
- Select the date & time property you want to use as the starting point (e.g., Deal Created Date, Contact Created Date, or a custom date property which is found back on your HubSpot corresponding workflow object.)
- Click on the property Date & Time to end at field.
- Select the date & time property you want to use as the endpoint for the calculation which is found back on your HubSpot corresponding workflow object.)
-
Select the Property to Store the Result:
- Click on the property Property to Set field.
- Choose the custom property you made, this is where the result (the number of days) will be stored.
Step 4: Save the Action
- Once you’ve set up the properties and options, click Save.
- The action will now appear as a step in your workflow.
Step 5: Test the Workflow
- Enroll a test record (e.g., a ticket or deal) into the workflow to verify the calculation.
- Check the record's properties to confirm the calculated days are stored in the target property.
Step 6: Publish and Monitor
- If the test is successful, publish the workflow.
- Monitor enrolled records to ensure the action works as intended across live data.