APIs & Integrations

ar-hz
Membre

How to send a value for [Single on/off checkbox] using form api

Résolue

I have tried sending TRUE(boolean), True(string), 1(int), 1(string) but none of them was captured in the form.

I am using PHP library https://github.com/HubSpot/haPiHP

Please guide.

Thanks.

0 Votes
1 Solution acceptée
benvanlooy
Solution
Contributeur de premier rang | Partenaire solutions Platinum
Contributeur de premier rang | Partenaire solutions Platinum

How to send a value for [Single on/off checkbox] using form api

Résolue

I know it's weird.. imo 0 or 1 would make more sense..
but what worked for me is sending TRUE or FALSE as string!

'true'

'false'

Voir la solution dans l'envoi d'origine

2 Réponses
IsaacTakushi
HubSpot Employee
HubSpot Employee

How to send a value for [Single on/off checkbox] using form api

Résolue

Thanks for weighing in, @benvanlooy. I agree this is a bit strange.

For others viewing this topic, if you're ever unsure of the format of a property's options, the "Get all [object] properties" endpoints are the best place to check.

For example, the Get all contacts properties endpoint returns two options for each property with the "fieldType": "booleancheckbox":

  • value": "true"
  • value": "false"

Isaac Takushi

Associate Certification Manager
benvanlooy
Solution
Contributeur de premier rang | Partenaire solutions Platinum
Contributeur de premier rang | Partenaire solutions Platinum

How to send a value for [Single on/off checkbox] using form api

Résolue

I know it's weird.. imo 0 or 1 would make more sense..
but what worked for me is sending TRUE or FALSE as string!

'true'

'false'