I am attempting to send information from Airtable to Zapier and ultimately a message to a client.
I am using the Automations > When Record Is Created trigger to Run Script. I am using the script from this article:
Instant Webhooks with Zapier and Airtable
My automation says it runs successfully in Airtable, and my Zapier says the Catch Hook runs successfully, but my QueryString is returning everything “Undefined”
Basically none of the data is being sent from Airtable to Zapier.
let url = "[ZapWebhook]"; // Replace the [ZapWebhook] with the webhook provided from the Zap Trigger step. let config = input.config(); // This allows the Input Variables to be used in the code. await fetch(url + "?RecordID=" + config.RecordID + "&FirstName=" + config.FirstName + "&LastName=" + config.LastName + "&Phone=" + config.Phone + "&Email=" + config.Email); // Concatenates the webhook URL with query string parameters and Input Variable values.
^^^ code being used if you don’t want to click the link.
Solved! Go to Solution.
My gut says that you need to URL-encode some of your data elements. The record ID can probably pass as-is, but I would definitely encode the rest, especially the email. Try this for the third line:
await fetch(url + "?RecordID=" + config.RecordID + "&FirstName=" + encodeURIComponent(config.FirstName) + "&LastName=" + encodeURIComponent(config.LastName) + "&Phone=" + encodeURIComponent(config.Phone) + "&Email=" + encodeURIComponent(config.Email)); // Concatenates the webhook URL with query string parameters and Input Variable values.