How can I use calculation property to convert string to date value?
SOLVE
I have a property whose name is `Date of birth`. And its value is string type looks like `1988-01-01`. I need to convert it to a date type property. It seems I can't do the conversation at runtime. I will have to create a new date type property then migrate the existing property to the new property. I am looking for an easy way to do that.
I need to make sure the migration does migrate existing property but it also needs to listen on any update on the existing property. If there is a change, the migration should pick up the change and update its value to the new property. This helps give 0 downtime.
What I am thinking is to create a calculation property, it looks like it does support migrating existing one and also pick up any update on the existing one. But the question I have is how to convert the string value to date type in the formula.
It seems to me like there's a simpler way to do that: if you want to populate a new actual date property with the information from your existing property, I'd recommend exporting your contacts (two columns suffice: record ID, date of birth), then re-import the contacts but this time you map the date of birth property to the new date property. HubSpot lets you specify a date form upon import.
This entire process should maybe 5 minutes. If you're concerned about downtime, you can still check how many new contacts have a date of birth but are missing a value in the new date property - and potentially update these few contacts manually.
Due to the nature of a birth date, I wouldn't expect any contacts where the value for the date of birth changes for that very short downtime.
Best regards!
Karsten Köhler HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer
It seems like you cannot create a calculation property to convert string property to a date property beacuse its giving me an error. But you can check this soltion here and give it a try. Though the solution of re-importing the values provided by @karstenkoehler more viable.
It seems to me like there's a simpler way to do that: if you want to populate a new actual date property with the information from your existing property, I'd recommend exporting your contacts (two columns suffice: record ID, date of birth), then re-import the contacts but this time you map the date of birth property to the new date property. HubSpot lets you specify a date form upon import.
This entire process should maybe 5 minutes. If you're concerned about downtime, you can still check how many new contacts have a date of birth but are missing a value in the new date property - and potentially update these few contacts manually.
Due to the nature of a birth date, I wouldn't expect any contacts where the value for the date of birth changes for that very short downtime.
Best regards!
Karsten Köhler HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer