API - Form Submit properties for multiple checkboxes

ryanwinchester
Member

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?

1 Accepted solution
Qiniso
Solution
Member

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

View solution in original post

0 Upvotes
10 Replies 10
KLewis28
Member

I reviewed the UI for a contact property, selected multiple options for a checkbox property, and performed a GET request to inspect the format. Over the next few days, I will be updating the documentation to include examples based on this process.

0 Upvotes
Qiniso
Solution
Member

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

0 Upvotes
ryanwinchester
Member

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

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

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.


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Upvotes
joewalsh
Participant

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

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


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Upvotes
joewalsh
Participant

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

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


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

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


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

ryanwinchester
Member

Thanks, that worked!

Where did you find this info?

0 Upvotes