Error Updating HubSpot Custom Date Field

Error Updating HubSpot Custom Date Field

book

Article ID: KB0078313

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) -

Description

If you attempt to update a custom date field in a Hubspot target datastore and you receive the following error:

Error detail: System.Exception: Error: INVALID_DATE

This indicates that there is a problem with the date from the source datastore.  For example, assume that the source field contains the date 21/03/2016 10:09:50.  This date appears to be a correct date, however, HubSpot Custom DateTime fields only accept DateTime data where the time portion of the field is set to midnight.

Issue/Introduction

Attempting to update a custom date field in a Hubspot target datastore and you receive the following error: Error detail: System.Exception: Error: INVALID_DATE

Resolution

Custom HubSpot “DateTime” fields are essentially “Date” fields behind the scenes and require the time portion of the field to be set to midnight.


When mapping your source data to a HubSpot target, use a formula in the target DateTime field to modify the data being sent.  For example, the formula below combines the DATEPART and DATE functions to retrieve the parts of the source date that are needed, and sends the modified date to the target. In the formula below, if no time is entered in the DATE function, the time defaults to midnight.
 
DATE ( DATEPART ("yyyy",lead.createdon), DATEPART ("m",lead.createdon), DATEPART ("d",lead.createdon) )

For additional information, see the following in the TIBCO Scribe® Online Help:  TIBCO Scribe® Online Connector For HubSpot, DATE Function, DATEPART Function