How to insert enumeration field values into forms API?
Hi,
I'm using PHP to POST form data to HubSpot Forms API. Everything works fine - submitted form data is stored in HubSpot correctly except enumeration fields.
I'm sending form data from my front-end APP to my backend APP and receives all data as an array in following structure:
Than I'm using PHP CURL to send this data further into HubSpot API. I'm using code almost exact the same as shown in API examples. Only difference is that I'm using http_build_query function to parse array. But there is problem with enumaration fields, which are sub-arrays. In my submission details enumeration field values has exclamation icons next to them. And the key names are bad, they are stored this way:
Hovering the exclamation icon gives me following error:
"This value wasn't passed to the contact record. 'some_enumeration_field_0_' isn't a contact property."
So how to send enumeration data to HubSpot API properly that it will be recognised as an array of values?
How to insert enumeration field values into forms API?
Hi @Peronczyk, looks like this is a quirk with HubSpot the values in an enumeration field should be separated by a semicolon. I was able to get a form submission to work by using this request body:
How to insert enumeration field values into forms API?
HI @Peronczyk, that error message seems to indicate that the enumeration property that you're trying to send data to in HubSpot does not exist. The field that stores the data in HubSpot has to exist on the contact in your property settings: https://app.hubspot.com/property-settings/HUBID/contact.
Can you check that the field exists in HubSpot that you're trying to pass data to? If that doesn't work, can you send me a bit more information?
The request body that you're sending back to HubSpot.
A link to the form in HubSpot that you're sending data to.