Jun 27, 2022 03:17 PM
So I’m really confused about where JSON inputs figure in Webhook Automation with scripter combinator.
Let me explain - so I have a webhook - let’s call it whatever here is a random one:
So I’ve just configured it with Insomnia and everything works and comes back with Success and that’s great - I’m excited but…
I want to pass variables to this Webhook… however no matter what I try it just doesn’t register. Here is the JSON I’m passing to my Webhook:
{“Company”: “HereBoy”, “Text”: “More Flavor”}
Here is my code in the script:
let table = base.getTable("SMS");
let inputC = input.config();
await table.updateRecordAsync('rec69N1WoIfzlUXJ1', {
"LinkID" : inputC.Company,
})
Webhook seems to be registering the values that are coming in when I check:
But when it’s a “set in stone” text it works - however my custom variable isn’t registered… if I could pass custom variables to the webhook for my script to work with that would be soooo awesome… maybe I’m fetching them wrong?
Thank you!
Jan 01, 2023 11:42 PM
You've probably figured this one out by now, but I suspect that within the Script Action you've simply forgotten to add the input from the Webhook for your "company" body key/value.
For an extra tip, note how I'm using a deconstruction method on the input.config() to simplify the extraction of value data - it's very easy once you understand how it works, and saves a lot of doubling up when you start to deal with lots of input.config() variables.