Add delay hours before a date / time

Hey,

sure, no problem. It’s a little confusing. I understand.
So yeah there a 2 workflows bascially. 1 workflow for calculating the date / delay and the other workflow for sending the email.

The 1st Worklfow should be built something like this:

At the start you calculate the date and time at when you plan the sendout based on a original date. In our case we want to send the email 3 hours before and appointment date and then save this new date/time value in a separate property called “before appointment date”. The custom code and actions in the workflow look like this then:

After this directly in the same workflow we only want to extract the full hours of the time in this new property we created and save the hours in a new property called “delay time”. You can do this by just adding the following 2 actions:

Here in the brackest as the first value you can directly insert the before appt. date property that was calculated directly before in the same workflow and then you just need to set the right timezone and country.
IMPORTANT: Setting the timezone and locale is optional. You can also leave this out and everything will still work. The time will then be in the value that is set in the hubspot app. For me since I’m not in the US, i needed to adjust it to my local timezone.

You can keep the second value in the beackets (the ‘HH’) as seen above since this will give you the full time hours in the new delay property.

But if you want to extract the hours (or even minutes) in a different format into the new property you can take a look here. Ther you can find all the formatting codes. For example typing ‘h:mm a’ in the brackets would result in 8:23 am.

That would be it for the first workflow. The second workflow is the one from the screenshot in my post before where you have all the branches based on the delay hours.

Does this answer all your questions?