API - Form Submit properties for multiple checkboxes


#1

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?


How to insert enumeration field values into forms API?
#2

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


#3

Thanks, that worked!

Where did you find this info?


#4

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.


#5

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


#6

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?


#7

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


#8

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?


#9

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