Skip to main content
Question

Zapier webhooks/Freshdesk API Request - Empty fields error

  • February 27, 2025
  • 1 reply
  • 0 views

I am trying to Put data to this endpoint: https://--Details removed by moderator--.freshdesk.com/api/v2/companies/

I am using the Freshdesk API request (Beta) but could also use the Webhooks by Zapier raw function.

 

I have successfully set up the component, with a JSON body that corresponds to tha API fields with static values, and it works. Here is the example:

 

{
    "name": "At Martins",
    "description": "Is the test working?",
    "note": "Where does notes go?",
    "account_tier":"Mid" ,
    "industry": "Aviation",
    "renewal_date": "2025-02-26",
    "domains": [
        "boobs.ai",
        "ff.com"
    ],
    "custom_fields": {
        "account_owner": "Jon",
        "account_record_id": "123",
        "planhat_id": "123",
        "contract_type": "Standard",
        "partner": "Advania Iceland",
        "region": "Nordics",
        "country": "Australia"
    }
}

 

My problem is that not all of these variables will always have an value, as they are not mandatory fields. However, when the api receives an empty/Null value, it throws an error.

 

So my question is, how do I set up a logic or dynamically change what variables is in the API request Body dependent on weather there is a value in the variable or not within zapier? Or how can I somehow otherwise avoid this error?
 

Did this topic help you find an answer to your question?

1 reply

SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7597 replies
  • February 28, 2025

Hey there, ​@BMulf 👋

Formatter’s (Text) Default Value action could be used to supply a value when one isn’t present but you’d need multiple Formatter actions, one for each field that might be empty.

A more efficient way to handle it would be to use a Code action to check multiple fields and output a default value if they are empty. If you’re not familiar with coding, you can use the Generate with AI option to generate the necessary code for you. You can learn more about this here: Generate a Code step using AI (Beta)

Hope that helps to get you pointed in the right direction. If you run into any issues on that or have more questions just let us know! 🙂


Reply