Not Blank the value while using batch API in Upsert
SOLVE
Hi HubSpot Community,
I’m currently working with the HubSpot Batch API to Upsert contacts, but I’m facing an issue with keeping certain fields unchanged when sending an empty value in the payload.
Here’s the issue:
1. First request: When I send a request to update firstname with "Contact1", it works as expected, and firstname is set to "Contact1".
2. Second request: Later, if I send another Upsert request with an empty string ("") for firstname, it doesn’t clear the existing value (i.e., "Contact1" remains). Instead, I’d like it to either clear or ignore this field, based on the scenario.
In this scenario, I would expect that sending an empty string should either:
- Clear the value in HubSpot if possible (resulting in an empty firstname).
- Or at least have an option to leave the current value unchanged.
Has anyone encountered this behavior or found a way to manage field values so that empty values can clear fields, or otherwise, avoid overwriting values?
Any tips or guidance would be greatly appreciated!
Not Blank the value while using batch API in Upsert
SOLVE
Hey @ketulpatel111, thank you for posting in our Community!
With the HubSpot Batch API, sending an empty string for a field won’t clear the value or keep it unchanged by default—it simply ignores empty strings, so the existing value remains. Currently, there isn’t an out-of-the-box way to clear fields with an empty string.
To handle this, you could try:
Using null instead of an empty string may clear the field.
If you want to ignore the field, omit it from the payload entirely.
To our top experts @Anton and @TomM2 do you have any recommendations?
This behavior can be limiting, but let us know if these options help or if you need further assistance!