Jun 20, 2019 1:13 AM - edited Jun 20, 2019 1:57 AM
I have referred the developer documentation regarding sending timestamp for hubspot submit form api. I even tried the default 1427997766000 shown in the documentation and it is not working.
Solved! Go to Solution.
Jun 20, 2019 12:19 PM - edited Jun 20, 2019 12:21 PM
Thanks for that info @edwinbbu , since your field is just a date field, the field must be set to UTC midnight, or the endpoint will not know what to do with that value, and HubSpot will not store the value in the CRM. Further, the V2 Forms API does not do any sort of validation, so you won't get an error if the data isn't sent to HubSpot, we'll just accept anything in that instance. For that reason, the V3 endpoint might be a better option. That said, if you're not seeing an error, would you be able to send the following info:
I was able to create this simple app that submits to the V2 Forms API a while ago where I've added in a date picker field. This properly submits to HubSpot as a UTC midnight value in milliseconds. Feel free to use it as a guide: https://repl.it/@cbarley10/Forms-V2-endpoint-in-Node-with-a-front-end
Here's an example of a contact I just created via that form with the value: http://prntscr.com/o4gx5j
Jun 20, 2019 10:24 AM
Hi @edwinbbu , happy to help! I'll need a bit more info first:
Thank you!
Jun 20, 2019 11:50 AM
Hi @cbarley ,
1. The field type is date picker. ( it is shown in contact property) .
Here is the link to the contact property
2. I am not seeing any error when submitting the form via api. I am submitting the datetime field(unix format) along with other fields. All other fields are getting updated.
3. I am not sending via ajax endpoint.
4. I am testing the forms via localhost so I am unable to share the link to page which is getting submitted to forms api.
Jun 20, 2019 12:19 PM - edited Jun 20, 2019 12:21 PM
Thanks for that info @edwinbbu , since your field is just a date field, the field must be set to UTC midnight, or the endpoint will not know what to do with that value, and HubSpot will not store the value in the CRM. Further, the V2 Forms API does not do any sort of validation, so you won't get an error if the data isn't sent to HubSpot, we'll just accept anything in that instance. For that reason, the V3 endpoint might be a better option. That said, if you're not seeing an error, would you be able to send the following info:
I was able to create this simple app that submits to the V2 Forms API a while ago where I've added in a date picker field. This properly submits to HubSpot as a UTC midnight value in milliseconds. Feel free to use it as a guide: https://repl.it/@cbarley10/Forms-V2-endpoint-in-Node-with-a-front-end
Here's an example of a contact I just created via that form with the value: http://prntscr.com/o4gx5j
Jun 21, 2019 2:18 AM
Thanks a lot @cbarley Finally the date type worked after converting to utc midnight format.
Jun 21, 2019 9:33 AM
Great to hear @edwinbbu !