CRM

ketulpatel111
Member

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.

For Example: 

First Request:

 

{ "inputs": [ { "id": "contact_id_123", "properties": { "firstname": "Contact1" } }] }

 

Second Request:

 

{ "inputs": [ { "id": "contact_id_123", "properties": { "firstname": "" } } ] }

 

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!

 

Thanks!

1 Accepted solution
BérangèreL
Solution
Community Manager
Community Manager

Not Blank the value while using batch API in Upsert

SOLVE

Hi @ketulpatel111 and @PFeldmannthanks for your patience as the Team was looking into this!

I am glad to share that this is now fixed!

If you set up a property to "", then it resets it for upserts as usual as for updates.

Just to let you know, please be aware of this:

- Setting a property to null does nothing
- Setting a property to "" is the only way to "reset" it

I hope this helps!

Have a lovely day and please let me know if there is anything else I can help with. I'll be delighted to do so!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


View solution in original post

0 Upvotes
8 Replies 8
BérangèreL
Solution
Community Manager
Community Manager

Not Blank the value while using batch API in Upsert

SOLVE

Hi @ketulpatel111 and @PFeldmannthanks for your patience as the Team was looking into this!

I am glad to share that this is now fixed!

If you set up a property to "", then it resets it for upserts as usual as for updates.

Just to let you know, please be aware of this:

- Setting a property to null does nothing
- Setting a property to "" is the only way to "reset" it

I hope this helps!

Have a lovely day and please let me know if there is anything else I can help with. I'll be delighted to do so!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


0 Upvotes
BérangèreL
Community Manager
Community Manager

Not Blank the value while using batch API in Upsert

SOLVE

Hi @ketulpatel111,

Just to follow up on this, I have just heard from the Team and they are actually working on a fix for this, as we speak.

Thanks for your patience and your valuable feedback!

I'll keep you updated on this.

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


PFeldmann
Participant

Not Blank the value while using batch API in Upsert

SOLVE

Hi BérangèreL
I can confirm the fix works for us. I have tested it.

BérangèreL
Community Manager
Community Manager

Not Blank the value while using batch API in Upsert

SOLVE

Hi @PFeldmann, great to hear and thanks for getting back to me on this!

I am delighted to know that all is working now!

Have a great week!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


0 Upvotes
PFeldmann
Participant

Not Blank the value while using batch API in Upsert

SOLVE

I'm having the same behaviour and can confirm both null or "" (empty string) doesn't clear the value. 

0 Upvotes
PamCotton
Community Manager
Community Manager

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!

 

Kindly,

Pam

 

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes
ketulpatel111
Member

Not Blank the value while using batch API in Upsert

SOLVE

@PamCotton i also apply null and "" but it still not worked..

here is my palyload..

{
"properties": {
"firstname": "hubspot",
"lastname": "contact101",
"email": "hubspotcontact101@test.com",
"phone": "4545545454545454545",
"address": null,
"city": null,
"state": "",
"country": null,
"zip": null,
"website": null,
}
}
BérangèreL
Community Manager
Community Manager

Not Blank the value while using batch API in Upsert

SOLVE

Hey @ketulpatel111, I hope that you are well!

For information, we have a new tool just for that, could you please share your feedback here: "Developer Feedback Tool".

Thanks a lot!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!