Clay Icon

Troubleshooting HubSpot Date Formats for CRM Updates

·
·

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?

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·

    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".

  • Avatar of Josh M.
    Josh M.
    ·
    ·

    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.

  • Avatar of Josh M.
    Josh M.
    ·
    ·

    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.

  • Avatar of Josh M.
    Josh M.
    ·
    ·

    Is it possible though to just set a formula using a UNIX timestamp in the original New Enrich Date column?

  • Avatar of Josh M.
    Josh M.
    ·
    ·

    🎉 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!

  • Avatar of Josh M.
    Josh M.
    ·
    ·

    Given Unix timestamp limitations, is there a better way to generate and sync this date?

  • Avatar of Bo (.
    Bo (.
    ·
    ·

    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.

  • Avatar of Josh M.
    Josh M.
    ·
    ·

    Ah! Thanks Bo (., much appreciated! Makes complete sense now. As you shared, this is the final formula I used to get the full unix timestamp:

    • moment().startOf('day').valueOf()

  • Avatar of Jacob T.
    Jacob T.
    ·
    ·

    Josh M. lmk if you want to chat through live on a call. My co-founder is an engineer and we built a custom Clay <> HubSpot integration to avoid these technical issues / power some cool enrichment features like custom overwrite rules etc.

  • Avatar of Channeled
    Channeled
    APP
    ·
    ·