APIs & Integrations

EdcoPeter
Member

Contact property data type boolean

For the API end point for creating a custom contact property, located here http://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property, is there a way to set the data type to be a boolean? Currently it seems an enumeration would have to be used, could a boolean type be added?

0 Upvotes
6 Replies 6
3PETE
HubSpot Employee
HubSpot Employee

Contact property data type boolean

Hey @NGraham1 .  You can use a single checkbox property to represent a boolean property since it only has an "on" or "off" function to it.  Here is a link to our Property Types: https://knowledge.hubspot.com/account/property-field-types-in-hubspot 

NGraham1
Participant

Contact property data type boolean

That makes sense! Thanks @3PETE 

0 Upvotes
NGraham1
Participant

Contact property data type boolean

Hi @3PETE  I'm generally curious why hubspot does not include booleans as a defualt property type. They are much more effecient than strings and make developer's lives a lot easier espeically when dealing with workflows and other things that use any sort of logic. It feels so wasteful to have to use so many string based enumations when they could just be simple booleans.  If hubspot is meant to be a robust, user friendly solution for businesses it seems like a pretty basic thing to include. Is there a reason they aren't included? 

ilan_berko
Member

Contact property data type boolean

Hey,
I have a similar issue.
I am now implementing the GDPR field in your system on our forms.
The type of the field ,by default, is a checkbox that gets TRUE/FALSE (boolean value).
I am sending the fields values through the API as an object. I see the object passing form my side through a pnp page on the Chrome in Devtools XHR tab. but the data doesn't pass to the hubspot database. all the other fields are passing. they are strings not boolean. only the checkbox boolean value doesn't pass.
What is the correct way to pass the boolean value to the hubspot database?

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Contact property data type boolean

@ilan.berko Can you please share with us an example of your call and the response from HubSpot?

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Contact property data type boolean

@EdcoPeter A property type cannot be added. Another possibility would be to use a Radio Button type that only has two options “True” and “False” This would maintain better consistency of a value only being either or

0 Upvotes