I have created a Hubspot form with over more than 10 properties and I'm using that to push contact information via API. I don't have any properties set as required, but if any of the data is "null", it doesn't push the data. I have attched a screenshot of my error.
Hi @Carol_Saldanha, which endpoint are you using? The V2 or V3 endpoint? Could you also share the request URL and payload you're sending to HubSpot? Thanks!
Hi @Connor_Barley. Thanks for your reply.
I'm using v3.
Here is an example of the data. One of the fields is null. If I remove that field, it does work. But, I want it to work even if there is any null data that is being passed.
Awesome thank you! I actually was able to reproduce this issue when using null as a value with the V3 endpoint. We don't allow fields that are null or undefined to be sent through the V3 API. They either need to be present or they can be set to an empty string. When I set a field to an empty string in my example, it works (does not clear the value either). You should make sure that all fields you're sending have values or have a default.
@Connor_Barley Also, the problem here is we do not know which value would exactly be null as it comes to us in a Google sheet form, and there are too many values to be set to an empty string.
To solve your issue of not knowing which value will be null, you could always use the || operator in javascript to set the value of that field to either the value entered, or "". I did something similar in a test file for the V3 endpoint which works!
@Connor_Barley : I figured this out and tried using the v2 endpoint instead that allows null field values. The script did run without any errors, but data did not get posted to the Hubspot form. I might be going wrong here with the "v2 endpoint" format. Please could you check the same.