how to add condition for empty response in an api call?
To handle an empty response in an API call, you can use conditional statements in Clay. Here's how:
1. Use the "Define field paths to return" option in the HTTP API integration setup.
2. Create a conditional statement to check for empty responses. For example: LBKSIF({{api_response}} == "") THEN "No data returned" ELSE {{api_response}}LBKS
This will return "No data returned" if the API response is empty, otherwise it will show the actual response.
If you're experiencing JSON-related issues or "failed to parse body" errors, please copy and paste the JSON into the chat so we can troubleshoot further.
does not work
Go to your Clay table and click on the column where the API response is stored. Click "Add Column" and select "Formula." Use the following formula to check for empty values.. IF(NOT({API Response Column}), "No Data Found", {API Response Column}) Click "Save & Test" to verify.
Hey there, thanks for reaching out! โบ๏ธ You can try: If /{APIResponse} is empty If this doesn't work, can you share your table?