I have a zap that either creates a deal (if it doesn’t already exist) or updates (if it exists) the properties of a deal in HubSpot. In many situations I need to blank out some deal properties in HubSpot because the updated data is blank for some fields. I know that I can use $$CLEAR$$ in the HubSpot Update Deal action, and that successfully blanks the fields in HubSpot. But I need to do this programmatically. I tried creating a Default Text action that made the default text $$CLEAR$$ if the property is empty, but that just resulted in the actual text “$$CLEAR$$” being passed to the HubSpot property. Is there a way to properly pass $$CLEAR$$ from a previous step to the HubSpot Update Deal action?
Passing $$CLEAR$$ as the output of an action to clear a field in HubSpot
Best answer by lukeb
You can map any Zapier value in the between the double quotes. If that field is empty, the request will simply contain ""
which will clear out the field. If it is not empty, it will updated with the contents of that value accordingly.
I’ve included how the action is setup in my Zap below. Hopefully this helps you and anyone else who was banging their head against the wall like me trying to figure this out!
See https://knowledge.hubspot.com/properties/organize-and-export-properties#:~:text=on%20a%20record.-,In%20your%20HubSpot%20account%2C%20click%20the%20settings%20settings%20icon%20in,right%2C%20click%20Export%20all%20properties for an easy way to export all your property names from HubSpot into a CSV. This made the process much easier for me.
App: HubSpot
Event: API Request (Beta)
Step details
Api Docs Info: Empty
HTTP Method: PATCH
URL: https://api.hubapi.com/crm/v3/objects/deals/{deal_id}
Query String Parameters: Empty
Headers: Empty
Additional Request Headers
Accept | application/json |
Content-Type | application/json |
Body
{
"properties": {
"hubspot_property1": "{zapier_property1}",
"hubspot_property2": "",
"hubspot_dealname": "{zapier_dealname}"
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.