# Workflow 'Invalid Property Value' Error with Custom Code Date Output

**URL:** <https://community.hubspot.com/t/workflow-invalid-property-value-error-with-custom-code-date-output/139869>\
**Category:** APIs & Integrations\
**Tags:** workflows, contacts, webhooks\
**Created:** [September 22, 2025, 10:51am UTC](https://community.hubspot.com/t/workflow-invalid-property-value-error-with-custom-code-date-output/139869 "2025-09-22T10:51:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJohnson4](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/djohnson4/32/92090_2.png) [@DJohnson4](https://community.hubspot.com/u/DJohnson4)\
**Post date:** [September 22, 2025, 10:51am UTC](https://community.hubspot.com/t/workflow-invalid-property-value-error-with-custom-code-date-output/139869/1 "2025-09-22T10:51:45Z")

</div>

I’m encountering a persistent issue with a workflow where a custom code action is failing to update a date picker property. The error i receive consistently is “Unable to update property becase property value isn’t valid” I have followed all standard troubleshooting steps and verified the data but the issue persists.

**My Setup**

I have a workflow with the following actions;

1. A **GET Webhook** returns a date string in this format: **2024-09-12T09:50:31.709704+0000**
2. A **Custom Code** action takes this date string, parses it, and outputs a unix timestamp in milliseconds.
3. A **Copy Property** action takes the custom code output and attempts to update a date picker property

**My Custom Code:**

```lia-code-sample
exports.main = (event, callback) => {
 const date_string = event.inputFields['creation_date'];

 console.log('Raw input from webhook:', date_string);

 if (date_string) {
 const cleaned_date_string = date_string.split('.')[0] + 'Z';
 const date_object = new Date(cleaned_date_string);
 const unix_timestamp_ms = date_object.getTime();

 if (!isNaN(unix_timestamp_ms)) {
 console.log('Final output (milliseconds):', unix_timestamp_ms);
 callback({
 outputFields: {
 formatted_date: unix_timestamp_ms
 }
 });
 } else {
 callback({ outputFields: { formatted_date: null } });
 }
 } else {
 callback({ outputFields: { formatted_date: null } });
 }
};

```

**What I’ve Verified**

- **Custom Code Logs:** The log confirms the code successfully converts the date string. The output for the given input is 1726134631000.
- **Data Type:** The formatted\_date output in the custome code action is explicitly set to the **Date** data type.
- **Property Type:** The property I am trying to copy the output to is a **Date Picker.**
- **Action Configuration:** The “Copy Property” action is correctly configured to copy the formatted\_date from the custom code to the date picker property.

Despite all the checks, the enrolment history for the “Copy Property” action continues to show the “invalid property value” error.  
Is there a specific detail about Hubspot’s date property handling that I am missing?  
Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [September 22, 2025, 12:01pm UTC](https://community.hubspot.com/t/workflow-invalid-property-value-error-with-custom-code-date-output/139869/2 "2025-09-22T12:01:28Z")

</div>

If it’s a Date Picker property that you’re pushing into, have you tried zeroing out the time in the date? I believe that the Date Picker property only accepts timestamps set to 0 hour.

---

<div class="post-metadata">

**Author:** ![DJohnson4](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/djohnson4/32/92090_2.png) [@DJohnson4](https://community.hubspot.com/u/DJohnson4)\
**Post date:** [September 22, 2025, 12:03pm UTC](https://community.hubspot.com/t/workflow-invalid-property-value-error-with-custom-code-date-output/139869/3 "2025-09-22T12:03:47Z")

</div>

Hi @MichaelMa,

Yeah, I have fixed this now with exactly as you suggested. I have modified the custom code action to set the time component to 0 hour and it works as intended.

---

<div class="post-metadata">

**Author:** ![MHirth](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MHirth](https://community.hubspot.com/u/MHirth)\
**Post date:** [February 27, 2026, 2:30pm UTC](https://community.hubspot.com/t/workflow-invalid-property-value-error-with-custom-code-date-output/139869/4 "2026-02-27T14:30:30Z")

</div>

OMG Thank you! 🙏
