• Live group demo of Marketing Hub + Data Agent

    Standardize reporting, reduce manual work, and introduce AI without cleanup

    Join us on March 12
  • Marketing that's efficient and human? That's Loop Marketing.

    Explore HubSpot Academy's 39-video playlist and put it into practice.

    Start learning

Contact property data type boolean

EdcoPeter
Member

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
1 Accepted solution
3PETE
Solution
HubSpot Employee
HubSpot Employee

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 

View solution in original post

7 Replies 7
3PETE
Solution
HubSpot Employee
HubSpot Employee

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

That makes sense! Thanks @3PETE 

0 Upvotes
NGraham1
Participant

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? 

PTancredi
Contributor

It also makes UI difficult. I want to represent boolean properties differently than I represent enumeration properties, but everything is either a string or enumeration type it seems.

0 Upvotes
ilan_berko
Member

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

@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

@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