Here's a handy webhook where you can calculate the number of days between dates. You just need to add a new Webhook and install it into the node where you want the calculation to take place. Here's how to set it up:
Step 1: Add the Webhook to your Organization
- Go to Apps & Integrations.
- Click on Add Webhook.
- Give the Webhook a name (like "Number of days"), and enter this for the webhook URL:
The end result looks like this:
Step 2: Call the webhook from your tree
Somewhere in your tree, you likely have 2 data entry fields that are collecting the first and second dates. Make a note of those date variable names. For example:
Open your tree, and edit the node where you want the date difference to be calculated.
- Under the Apps / Webhooks section, click Add App.
- Pick the Webhook you added previously ("Date Difference", for example).
- In the Message Data area, enter something like this:
&date1=#date1#&date2=#date2#&var=diffReplace #date1# and #date2# with your own variable names for the first and second dates
- Save the changes to the node.
Your edits should look something like this:
Now just use #diff# anywhere you want to show the date difference. Example: