4 weeks ago
I have a workflow rule where I grab a date/time field with custom code and update that field to a date field (MM/DD/YYYY) as an output.
Example:
Date/time: 2024-06-21T00:29:23.243Z
Date: 06/21/2024
I receive a "Success" message when testing the custom code. However, when I copy the output date and input it into my "signup_date" field I receive a message saying "Unable to update property because property value isn't valid." I've played around with the format of the output date to YYYY/MM/DD and DD/MM/YYYY as well as with "-" instead of "/" ... but no luck! 😞
How can I fix this?Custom Code
Success Message from Code
Workflow
Error Message
Solved! Go to Solution.
3 weeks ago - last edited 3 weeks ago
The date must best set to midnight in order to copy via native workflows.
Here are my tests:
code used
output defined as datetime
in milliseconds with time set to midnight
string set to midnight
![]() | Michelle Tabor • michelle.tabor@lyntonweb.com Solutions Engineer | Full Stack Developer | HubSpot Architect Lynton • HubSpot Elite Partner |
3 weeks ago - last edited 3 weeks ago
The date must best set to midnight in order to copy via native workflows.
Here are my tests:
code used
output defined as datetime
in milliseconds with time set to midnight
string set to midnight
![]() | Michelle Tabor • michelle.tabor@lyntonweb.com Solutions Engineer | Full Stack Developer | HubSpot Architect Lynton • HubSpot Elite Partner |
2 weeks ago
Thank you Bortami, this did the trick!
To summarize to copy the date time fields to a date field, the custom code must change the date/time field to set to UNIX milliseconds at midnight.
3 weeks ago
@lana604 - based on my own efforts on this topic, the only acceptable format for a date output from a custom code workflow is a timestamp value in milliseconds - not a formatted date string as you might expect. As in 1708905600000 rather than 2024-02-26.
Hope this helps!
Steve
| |||||||||||||||||
| |||||||||||||||||
Create Your Own Free Signature |
3 weeks ago
Hi Steve,
I updated the output code to time stamp value in milliseconds, unfortunately, when I copy the property value to my date field, I get the same error where "property value is not valid...."
I'm thinking this might be a HubSpot limitation. I have developers looking into this but so far no luck .
4 weeks ago
What is the field type for that signup_date custom field?
3 weeks ago
It's a Date Picker field. My date format is the United States, so MM/DD/YYYY.
I do not have any validation rules associated to the field.
4 weeks ago
That and check for property validation rules