Mar 14, 2023 09:58 AM
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?
Mar 18, 2023 12:06 AM
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.
Oct 11, 2023 05:13 PM
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'
}
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 🙂
Dec 06, 2023 09:01 AM
Very much hoping Airtable will add support for accessing the raw JSON.
Dec 27, 2023 09:34 AM
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
Mar 19, 2024 08:31 AM
That's what i was looking for. Thank u 😍
Aug 14, 2024 01:55 PM - edited Aug 14, 2024 01:56 PM
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.