Skip to main content

I have an automation triggered by an incoming POST web hook.

I do not have control over the format of this workbook however it send its content as a JSON whose structure can vary but at the top level contains a key "data" which is an array of objects each containing information about a particular answer in a form response.

e.g 

{
"data": [
{
"title": "What survey/inspection would you like?",
"description": null,
"type": "choices",
"key": "d747n",
"custom_key": null,
"value": "Level 1 Health Check"
},
{
"title": "",
"description": null,
"type": "hidden",
"key": "4pf996l",
"custom_key": "age",
"value": "4"
},
{
"title": "",
"description": null,
"type": "hidden",
"key": "9b8fc",
"custom_key": "cost",
"value": null
}
]
}

This means that the when trying to use the data in a script using inputConfig it wants to create a list of values e.g a list of all "custom_keys" or all "types"... not helpful. Moreover it can't actually create a list of the values for the key "value" as it says

"Cannot assign list of collection of complex types to collection of complex types"

Is there no way to simply get the full payload of a webhook as a variable for my script beyond using some external service to serialize it and then parse  in the script?

I thought I may have been able to help with this one, but then found the exact same limitation - we can't simply import the body as an object into a scripting action.

Then I thought, I might try out the recently released Repeating Group action to process your data as a list, but it again hits similar issues, as per the below screenshot.

"Cannot assign list of collection of complex types to collection of complex types"

This is worth raising as a feature request with Airtable, I dare say it must have been requested countless times already. I've always had the luxury of writing my own Post requests, so haven't hit this problem before.

 


Hiya, not sure if my response is helpful, but thought I would share as I have also been trying to get around this, it's very annoying. In the end I just sent my data as a massive string and split it on the receiving side with a script.

Where previously my data for each clash looked the same as yours:

e.g.:

 

{
'name': 'Katie',
'date': '12th Oct 2023',
'job': 'This is the name of a job'
},
{
'name': 'Katie',
'date': '12th Oct 2023',
'job': 'This is the name of a job'
}

 

 
I just concatenated it into a string like:

 

let clashes = "Katie, 12th Oct 2023, This is the name of a job, Katie, 12th Oct 2023, This is the name of a job"

 

and then sent it like this:

 

method: 'POST',
body: JSON.stringify({"clashes": clashes}),
headers: {
'Content-Type': 'application/json',
},

 

Then you can access everything at once 😊

I will split by "," and deal with the array.

Not cleanest solution, but it's worked for me 🙂


Very much hoping Airtable will add support for accessing the raw JSON.


Something I've done in the past is go to "run history" and use developer tools > network tab to get JSON for the specific message. If you open up a specific automation call, you'll see calls to 

 

https://airtable.com/v0.3/workflowExecution/{workflow_ID}/read?. .. labelled  in developer tools as read?..

The first two request (at least for me) are the test data used by the workflow. The last request actually contains the json blob of the incoming webhook call. Hope this helps


Hiya, not sure if my response is helpful, but thought I would share as I have also been trying to get around this, it's very annoying. In the end I just sent my data as a massive string and split it on the receiving side with a script.

Where previously my data for each clash looked the same as yours:

e.g.:

 

{
'name': 'Katie',
'date': '12th Oct 2023',
'job': 'This is the name of a job'
},
{
'name': 'Katie',
'date': '12th Oct 2023',
'job': 'This is the name of a job'
}

 

 
I just concatenated it into a string like:

 

let clashes = "Katie, 12th Oct 2023, This is the name of a job, Katie, 12th Oct 2023, This is the name of a job"

 

and then sent it like this:

 

method: 'POST',
body: JSON.stringify({"clashes": clashes}),
headers: {
'Content-Type': 'application/json',
},

 

Then you can access everything at once 😊

I will split by "," and deal with the array.

Not cleanest solution, but it's worked for me 🙂


That's what i was looking for. Thank u 😍


Having the exact same problem. I am using an automation to integrate with Stripe. The payload of their payment completed webhook is different based on the type of payment and I would very much like to be able to load the full body in a script...

Obviously in that case changing the format of what is being sent is not an option.


Same as ​@Christian_Roy , trying to parse some Stripe data as well, but need the raw payload and we’re stuck - any other ideas here?


You can probably do this with JavaScript, but I don’t know JavaScript so I do this with Make’s custom webhooks.

Alternatively, it is probably even easier if you do this with Make’s native Stripe integrations alongside Make’s native Airtable automations.

If you’ve never used Make before, I’ve assembled a bunch of Make training resources in this thread.

I also give live demonstrations of how to use Make in many of my Airtable podcast appearances. For example, in this video, I show how to work with Airtable arrays in Make, which might be useful if you’re dealing with arrays from Stripe.

Hope this helps!

If you’d like to hire the best Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


Thanks ​@ScottWorld - We have a fairly extensive Zapier environment already setup, but was excited and hoping to go straight from Stripe to AirTable, but looks like we may need to bring back Zapier for this.

 


You’re welcome! If you have some free time, you may want to consider playing around with Make. It is a million times more powerful than Zapier, and it is significantly cheaper too. I wrote a post here comparing Zapier vs. Make


In case it helps or sparks some additional ideas, I would suggest you also take a look at n8n (you can self host it, and easily include some javascript scripts on your workflows -more on this here).

Mike, Consultant @ Automatic Nation 
YouTube Channel


@sriram Bit of a clunky workaround, but the last time I hit this problem I ended up using a Run a Script action to do a GET of the data from the source to get the raw payload heh


@TheTimeSavingCo - funny, that’s exactly what I ended up implementing this afternoon.  Have you noticed any failures or odd (timeout?) errors as a result of this fetch step in production?


Ha nice!  Hmm, nope, what errors are you facing?  When you say timeout, you’re talking about the script 30 seconds timeout thing?


@TheTimeSavingCo - Yea, or in case the other endpoint doesn’t respond or something strange.


Hmm, for the timeout one, for me that was because the service I was using had to handle some stuff in the background before responding.  Thankfully they offered a webhook service, and so I ended up doing 2 automations, one to ping the endpoint, one to receive the data

  1. Automation 1: Ping their endpoint to start the process, pass it Automation 2’s webhook URL
  2. Automation 2: Webhook triggered endpoint to receive the data

This...probably puts you right back at square one though unless your service offers a ‘Select your output schema’ thing though

---

Not really relevant, but I also did have some issues scraping pages via a Run a Script call, but that's par for the course for most scraping; figured it was a combination of the call coming from a datacenter IP and probably blacklisted for scraping like this and pages loading with JS that a call wouldn’t work for.  You’re doing a Stripe call so that’s not that useful here, but figured I’d mention it anyway

Sigh, looks like you’re back on the Zapier train


Reply