Help

Send specific fields to Zapier on Airtable Button Click

Topic Labels: Integrations
Solved
Jump to Solution
1087 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Richie_Siegel
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi there,

I am looking to use the Button run script field in Airtable to send specific data from my table into Zapier.

Does anyone have a template script they can share? This is what I have so far.

let url = "https://hooks.zapier.com/hooks/catch/TKID?recordID=?name=?";

let table = base.getTable("Table 1");

let view = table.getView("Grid view");

let record = await input.recordAsync("Pick a record", view);

let name = record.getCellValueAsString("Name")

let email = record.getCellValueAsString ("Email")

await fetch(url + record.id + "%name=" + name + "%email=" + email);

My understanding is the steps are:

  • Create Button field
  • Add in script that posts to Zapier webhook
  • Catch data from Airtable
  • Run rest of the Zap

Just looking for help on the Airtable script side.

Thank you.

1 Solution

Accepted Solutions
ScottWorld
18 - Pluto
18 - Pluto

You could use a script, but it’s unnecessary. Your button can just trigger the webhook URL on its own.

Just add the Record ID of the record as a parameter to the end of the webhook URL, and then have Zapier find the record based on its ID.

(You can also add in extra parameters if you’d like, but those are unnecessary as well.)

See Solution in Thread

4 Replies 4
ScottWorld
18 - Pluto
18 - Pluto

You could use a script, but it’s unnecessary. Your button can just trigger the webhook URL on its own.

Just add the Record ID of the record as a parameter to the end of the webhook URL, and then have Zapier find the record based on its ID.

(You can also add in extra parameters if you’d like, but those are unnecessary as well.)

@ScottWorld ah thanks so much. Sorry very new to this.

So in the URL formula then I right now have the below but it isn’t splitting off Name and Email on the Zapier end. Assuming I am doing something wrong syntax wise?

"https://hooks.zapier.com/hooks/catch/TK?"&"name="&Name&"?email="&Email

You’ve got your URL setup incorrectly. It needs to look like this:

"https://hooks.zapier.com/hooks/catch/TK?name=" & ENCODE_URL_COMPONENT(Name) & "&email=" & Email

However, like I mentioned above, it’s easier & more versatile to just send the record ID to Zapier:

"https://hooks.zapier.com/hooks/catch/TK?id=" & RECORD_ID()

@ScottWorld Thanks for the help. Really appreciate it.