When I use the Raw Catch Hook, everything seems fine, but I can’t seem to access array elements properly in my JavaScript code:
var result = JSON.parse(JSON.stringify(inputData));
console.log(result.profiles[0]);
return result;
This returns an error “TypeError: Cannot read property ‘0’ of undefined”. On the other hand, the regular Catch Hook processes the data in a weird way that makes it unusable. How can I correctly access the profiles[0] array values when using Zapier webhooks?
Check if your webhook’s sending form-encoded data instead of JSON. Zapier gets confused with content types and dumps everything into inputData.body as a string. Try console.log(typeof inputData.body) first - if it’s a string, you’ll need JSON.parse(inputData.body).profiles[0]. Also, CleverTap sometimes flattens arrays, so profiles might show up as profiles__0__ or something weird in the data structure.
Had the same headache with Zapier webhooks a few months ago. Zapier’s probably not parsing your JSON right when it hits the Raw Catch Hook. First thing - log the entire inputData object to see what you’re actually getting. Zapier loves to wrap payloads weird or flatten nested stuff. I had to use inputData.body or inputData.querystring depending on the webhook setup. Also make sure your sending system sets Content-Type to application/json. If that doesn’t fix it, try inputData.rawBody and JSON.parse that directly instead of the stringify/parse thing you’re doing.
Double-check CleverTap’s webhook config - they nest payloads differently depending on the trigger type. Hit this same issue when I integrated CleverTap with another platform. The profiles array got wrapped in an extra layer that wasn’t obvious from their payload preview. Try inputData.data.profiles[0] or inputData.payload.profiles[0] instead. CleverTap loves nesting webhook data under event-specific containers. Also make sure your Zapier webhook URL is set as the right endpoint type in CleverTap - campaign vs profile webhooks can send the same data but with totally different wrapper structures. Fire off a test webhook straight from CleverTap’s interface to see what Zapier actually gets versus what their docs show.
This is a common issue with Zapier’s Raw Catch Hook. The webhook payload usually gets nested under different properties depending on how the data comes in. First, try inputData.body.profiles[0] instead of inputData.profiles[0]. If that doesn’t work, add console.log(Object.keys(inputData)) to see what’s actually available. Zapier sometimes stores the parsed JSON under body or parsed. Also check that CleverTap’s sending the webhook via POST with proper headers - I’ve seen the data structure change based on HTTP method. Add a safety check too: if (result.profiles && result.profiles.length > 0) before accessing the array element.
Zapier’s webhook handling is a mess for reliable JSON parsing. I’ve dealt with this for years - ditch Zapier for something that actually handles webhooks right.
The problem happens because Zapier’s Raw Catch Hook doesn’t parse incoming data consistently. Sometimes it’s under body, sometimes flattened, sometimes arrays break completely.
I switched to Latenode for CRM webhook integrations. It parses JSON like you’d expect - no weird nesting or mangled data. Your profiles array shows up as profiles[0] without any hoops.
Your CleverTap to Intercom flow would work exactly as written with Latenode. Webhook gets your JSON, you access profiles[0] directly, done. You also get proper error handling and data validation.
I’ve connected dozens of CRM systems this way. Never had to guess where data ended up or write defensive code for basic array access.