If I understand your objectives clearly, there is a way and I do this a lot in a number of systems. In this screenshot, take a close look at the left pane containing input parameters into the script action. You can see that two elements from the webhook post (the first step in the automation) includes values from the body of the HTTP POST.
@Bill.French Thanks, I finally figured as much, but this is rather limited when you want to use objects or dynamically provided structures. I just wanted to manipulate a “data” element with unforeseen structure, not doable.
Also, you leaked your API access key in the above screenshot, not sure if that was intended!
The first workaround for this is possible if you have control over the service making the webhook call. Simply serialize the entire payload into a single data field, and then extract and parse that field on the Airtable side.
The second workaround is to create a proxy service using Autocode. Post the webhook call into your proxy service, serialize the payload into a single added element, and push the augmented payload to its final Airtable webhook endpoint.
Both approaches will require a comprehensive enumeration of payload to handle the anticipated dynamic structure of the data, but that was a given in your scenario at the outset.
I’ve had success with each of these approaches.
It’s not uncommon for Airtable to paint integration developers into corners like this; there’s a long and storied history of shortcomings like this one. But, this one in particular is a doozy.
They really need to have some senior integration experts on their team who will regularly question the data interchange design, in this case, the inability to foresee that someone might actually want to treat body as a field containing a collection of fields which themselves may also contain additional fields.
In the final analysis,
Is it possible to read a webhook data from a script?
Yes, absolutely. But it is not possible to read [arbitrary] dynamic data, the likes of which tend to occur in more than 50% of the cases.
Honnestly, I’ve used the Next.js framework with Vercel cloud hoster and I have my own “webhook” script that does exactly what I want, without the Airtable crazy limitations. Took me about 3h to get straight. (oh, and it’s secure, too, unlike those **** AT webhooks which don’t even embed any kind of authentication system)
It won’t count towards my 25 automations quota, and it won’t count toward my 50k monthly automations runs. And the code is properly versioned.
Good point. However, sometimes actual developers are forced into helping their clients and organizations adapt to new platforms. Whether this “no-code” platform was ever intended to have a scripting element is uncertain, but the irony of all the code required to make it work well does not escape me.
I figured you did, but by comments nudged along by your comments, were intended for the vast audience of users and low-code builders who want to better understand the issues and need alternative approaches.