Store Today's Date in a Contact Record Property for Time Between Calculations and Reporting

MatthewShepherd
Por:
Asesor destacado

ORIGINAL AUTHOR: Neal Morrin, HubSpot

PURPOSE & USE CASE

This workflow stores and updates today’s date in a contact record property as a start or end date for use with Time between date-based calculations e.g. calculate / report on how many days have past since another date property. Uses three connected workflows; this can be done more efficiently with Ops Hub. 

Update: I have also found a different approach that uses one workflow in the community here.

Note:

  • These workflows can potentially update a large number of records on a daily basis, so please only use where today's date is required across a large proportion of your records e.g. you need to calculate age based on date of birth for all contacts.
  • If possible custom code via Ops Hub Pro would be a more efficient way to set today's date and/or calculate time between values based on today's date.
  • While this workflow sets today's date in contact records, a copy property value action could copy today's date to a custom datepicker property in other record types too.

 

HOW IT WORKS
Here's a Loom video from Neal walking through how this works: https://www.loom.com/share/5ccb72780f6c4f848a14287cf7009b74


This solution uses three connected workflows:

1-Contact: Set Today's Date for First Time:
Sets the initial value of a 'Today's date' datepicker property to the date of step when a record is first found where this property is unknown.

2-Contact: Set Today's Date Trigger:
When the 'Today's date' property is known we then store today's date in a 'Today's date dummy' step which will be used to trigger our third workflow to update our date on a daily basis.
3-Contact: Update Today's Date:

Using a date-centred contact workflow based on the 'Today's date dummy' date, when 'Today's date dummy' is known we trigger the workflow one day after 'Today's date dummy' to update the value of 'Today's Date' to the date today. As 'Today's date' is updated the record will enter workflow 2 again and cause this process to loop on a daily basis.


NOTES ON CONFIGURATION


Enrollment criteria: See above
Allow Re-enrollment?: All workflows allow re-enrollment based on updates to the trigger contact property (except for today's date is unknown which should only happen once at record creation anyway)
Goals: None
Settings: None
Actions configuration: See above
Custom properties:
'Today's date' - datepicker
'Today's date dummy' - datepicker
Associated workflows: See above

IMAGE

1-Contact: Set Today's Date for First Time

 

MatthewShepherd_0-1664290814691.png

 

2-Contact: Set Today's Date Trigger

 

MatthewShepherd_1-1664290837683.png

 


3-Contact: Update Today's Date

 

MatthewShepherd_2-1664290850773.png

 

Date last updated: February 15 2024

 

2 Comentarios
LeeBartelme
HubSpot Employee
HubSpot Employee

I think this workflow can be further simplified by removing the today's date dummy property. This also forces you to not center the workflow on a date, which isn't currently possible for all objects. So to make this applicable to all object types you can do the following with one property and two workflows.

Workflow A only listens for changes in the today's date property, waits 2 minutes and then puts it in the Workflow B. Workflow B waits until 1 day after today's date, and sets today's date, thus enrolling it in Workflow A again. Main benefits are no dummy property and can use this setup for all object types.

 

Workflow A:

LeeBartelme_2-1676987778773.png

Workflow B:

LeeBartelme_3-1676987786364.png

 

 

ibelice2024
Colaborador

Hi guys, I have a question regarding the current date to calculate the contact property ‘age’ based on two contact properties ‘Date of birth’ ‘Today's date’. In order to make the property ‘Today's date’ to be updated every day is it necessary to have Hubspot Operation PRO?

 

Is there another way to calculate the ‘age’ property without using hubspot operations?