APIs & Integrations

ryanwinchester
Member

API - Form Submit properties for multiple checkboxes

I am having a problem figuring out how to format the data for submitting a multiple checkbox property.

I have tried every combination of any values and keys I could think of.

What would make sense to me is something like:

{
  "property_name":  ["internal_value1", "internal_value2"]
};

or even

{
  "property_name": [
    {"internal_value1": true},
    {"internal_value2": true}
  ]
};

Anybody know the magical phrase to unlock the special secrets?

9 Replies 9
Qiniso
Member

API - Form Submit properties for multiple checkboxes

After trying different combinations, I eventually got it right by adding a space after the semi-colon.

0 Upvotes
ryanwinchester
Member

API - Form Submit properties for multiple checkboxes

I’m starting the process of compiling “gotchas” here

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

API - Form Submit properties for multiple checkboxes

I went into the UI for a contact property, checked multiple options for a checkbox property, then did a GET for that contact and looked at the format. I’m going to be updating the documentation over the next few days to provide some examples of this.

0 Upvotes
joewalsh
Participant

API - Form Submit properties for multiple checkboxes

Unfortunately, this doesn't work any longer. I also couldn't find any documentation of this apart from this thread. Any ideas how to make it work?

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

API - Form Submit properties for multiple checkboxes

Hi @joe_walsh,

Semicolon-separated values are still working for me. They are documented in our FAQs section here: https://developers.hubspot.com/docs/faq/how-do-i-set-multiple-values-for-checkbox-properties

If that doesn't get you going, feel free to post the POST body you are sending into HubSpot so I can help in more detail.

-Zack

0 Upvotes
joewalsh
Participant

API - Form Submit properties for multiple checkboxes

Hi Zack,

Thanks for your response. While this does work when you update a contact directly (I can confirm as well), it doesn't work for what this discussion thread is about: Sending multi-checkbox values through the Forms API.

Can you give it a try and let me know if sending multiple values through the Forms API works for you?

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

API - Form Submit properties for multiple checkboxes

Hey @joe_walsh,

Sorry about that, I should have clarified that I did use the Forms API. Here is a screesnhot of what I sent in via Postman

Let me know if that doesn't work for you for some reason.

-Zack

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

API - Form Submit properties for multiple checkboxes

Hey @ryanwinchester,

You can send the selected options as strings with each option separated by a semi-colon.

{
"property_name":"internal_value1;internal_value2"
}

Thanks,
Zack

ryanwinchester
Member

API - Form Submit properties for multiple checkboxes

Thanks, that worked!

Where did you find this info?

0 Upvotes