Custom field type/validation changes and existing values failing updateSOLVE
Jan 16, 2020 12:49 AM
I'm trying to get to the bottom of some wierd errors my clients keep getting. It looks like HubSpot CRM users can change a custom field type from one to another without existing fields being changed (until editing). At least, this is my assumption.
The backstory: We're trying to update a company with a field value that was fetched from the user account shortly before. We get a validation error that the enumeration or input type is not correct. Our latest example is a custom field value we pulled which is suppose to be an ID that has numbers and letters, on update we get a integer validation error because of the text. How could those invalid values exist if we're no longer allowed to update them with the same value?
This is what I need to know:
- Can custom fields change type from say a very loose type like "text" to a stricter type like "integer"? If so, what would be the suggested maintenance to update existing values that contain text when such a custom field change is made?
- Have there been any number field changes in the HubSpot API that would have caused existing field values to become invalid?
- In which cases would we expect existing field values to be stored but not pass validation on update? How do we work around this?
This has been an issue for multiple customers now. I don't know who holds the burden of responsibility here. If it's ours I've love to know so we can fix it right away.
Solved! Go to Solution.
Jan 23, 2020 11:28 AM
Apologies for the delayed response.
A HubSpot user can indeed change the
type of a custom object property via the UI.
Following your example, if a custom company property with
"type":"string" is changed in-app to
"type":"number", then you as the integrator will no longer be able to write strings to the property, but the company's value will remain a string. HubSpot does its best to retain known values despite incompatible changes to the property's
I'll try to address each of your specific questions:
- Yes, custom fields can change
type. If you need to write a string back to that field, you must change the custom property's
stringvia the corresponding object properties API, undoing the in-app change.
- There haven't been any recent changes to how HubSpot treats
typeproperties, and HubSpot would not programmatically change the
types of custom object properties.
- Per the first bullet point, all cases. The only way to work around this would be to undo any user changes to a property's
Isaac TakushiAlumnus, HubSpot Developer Support