Developer Announcements

Dadams
HubSpot Employee
HubSpot Employee

Bugfix - Incorrect validation for properties using the bool type

On November 18th, we're making an update to property validation for any CRM properties using the "type": "bool". Currently, these properties are not validated correctly, making it possible to store any string value in these properties. This can cause issues with other systems using these boolean properties, such as triggers or branching actions for workflows, as well as list memberships.

 

After this fix, only the values true and false (case sensitive) will be accepted. Any other values will result in an error. This validation will be applied to any updates to any CRM records that contain a bool property, including creating and updating records.

 

This change will affect all existing bool properties, including any custom properties created using the CRM APIs, as well as any HubSpot-created properties (properties with "hubspotDefined":true).

 

Note: Single checkbox properties created by a user in HubSpot use the enumeration type, which are not affected by this as they already correctly validate the true and false options. As a reminder for all enumeration type properties, you must use the value for the option you want to use, not the label.

 

When is this happening?

The new validation will be applied to all CRM record updates beginning on November 18th.

 

Please let us know if you have any questions by replying below.

2 Replies 2
PDenning
Member

Bugfix - Incorrect validation for properties using the bool type

We've recently been getting the error:

 

HTTP response body: {"status":"error","message":"Boolean properties must have exactly two options; one with a value of 'true', the other with a value of 'false'. Property '<property_name>' of object type '0-2' has more than two options","correlationId":"c2c2ea06-bb17-45aa-8aa5-9a93ce73ef1e","context":{"property":["<property_name>"],"objectTypeId":["0-2"]},"category":"VALIDATION_ERROR","subCategory":"PropertyValidationError.INVALID_BOOLEAN_OPTION"}


The options we were providing when we started seeing the error were:

"options": [
{"label": "Yes", "value": "true"},
{"label": "No", "value": "false"},
]



We have since tried updating them to:​

 
"options": [
{"label": "Yes", "value": True},
{"label": "No", "value": False},
]
 

 


But we are still seeing the same error.

Could this be related to the above change?


We have tried creating a string property as a workaround. But we will have to update the property for existing users, which fails with:​



"Property '<property_name>' of object type '0-2' and type 'string' cannot have options.",



It seems our only remaining option is to delete all existing columns for users and then create a new string property.



Can you advise as to whether our issue is to do with this change? If so, could you suggest why the attempt to create with the boolean values (Python) is failing. Alternatively, is there a way to change the type of an existing boolean property to string?

Many thanks,
Patrick


LKnobling
Participant | Diamond Partner
Participant | Diamond Partner

Bugfix - Incorrect validation for properties using the bool type

same question here

0 Upvotes