Hi all,
I’m new to javascript/airtable scripting and I’m trying to add the content of a form to a webhook when it is submitted. (Check in date, Check out date and Number of Adults)
At the moment I have an automation to trigger when a form is submitted with the action of running a script.
This is the script:
let table = base.getTable("Managed Service");
let view = table.getView("Check Availability");
let url = "https://hook.integromat.com/[hidden]?";
let checkInDate = table.getField("Check in date");
let checkOutDate = table.getField("Check out date");
let adultsNumber = table.getField("Number of Adults");
await fetch(url + "&checkInDate=" + checkInDate + "&checkOutDate=" + checkOutDate + "&adultsNumber=" + adultsNumber);
console.log(url + "&checkInDate=" + checkInDate + "&checkOutDate=" + checkOutDate + "&adultsNumber=" + adultsNumber);
When the script runs I get the webhook pushing to integromat, however the variables just show [object Object] as seen here:
Console log:
https://hook.integromat.com/[hidden]?&checkInDate=[object Object]&checkOutDate=[object Object]&adultsNumber=[object Object]
Integromat:
[
{
"checkInDate": "[object Object]",
"checkOutDate": "[object Object]",
"adultsNumber": "[object Object]"
}
]
I need this values to be specifically what was submitted in the form.
Any help would be greatly appreciated :slightly_smiling_face:
