Struggling to get an enrichment date into HubSpot. I've gone through the Keeping your CRM up to date video and have tried various date formats:
moment().format("YYYY-MM-DD")
moment.utc().format()
Date.getTime()
And others. I get a blank or an error when the update to HubSpot runs. What is the formula to send a date back to HubSpot?
To successfully send a date to HubSpot, you need to use Unix time set to midnight. Here's how to do it: 1. Use the Format Date/Time formatter in Clay. 2. Select "Unix Timestamp" as your output format. 3. Keep the column type as text, not date format. This approach ensures compatibility with HubSpot and avoids formatting issues. Remember to match the data type in your Clay table with the corresponding field type in HubSpot to prevent export failures. If you need further assistance, please request human help by clicking "Talk to a person".
I believe I've tried that as well. Changing the column to text sets it to a string of numbers that HubSpot interprets incorrectly. I've also tried moment().utc().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]") and get an error. The error is always the same: Property values were not valid. And only happens when attempting to set a date.
Ok, I was finally able to get it by adding the Clay date formmater column to change the Enrich date moment().format('') to a Unix timestamp.
Is it possible though to just set a formula using a UNIX timestamp in the original New Enrich Date column?
🎉 Ok, yes, it's possible. This is what I used to have a single column sync the current enrichment date to HubSpot:
moment()?.unix()?.toString() + "000"
Appending the 000 seems wonky but that's the only way I got it to work. Would love to know if there's a better way!
Given Unix timestamp limitations, is there a better way to generate and sync this date?
Hey Josh — Yes, you can use that method! Here’s a quick walkthrough that shows how: Watch video Let me know if you’d like help tweaking the formula or exploring a cleaner way to format the timestamp.