Apr 04, 2021 07:45 AM
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:
Just looking for help on the Airtable script side.
Thank you.
Solved! Go to Solution.
Apr 04, 2021 08:13 AM - edited Aug 14, 2023 05:33 AM
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.)
However, I strongly recommend using Make instead of Zapier. Make is infinitely more powerful & flexible & customizable than Zapier, and it is also significantly cheaper as well.
I’ve written an entire post here about Make vs. Zapier.
You can do the exact same thing that I mentioned above with Make, and you can also trigger it with a script instead of a button. Here’s how to do it with a script: https://air.tableforums.com/t/sending-airtable-data-to-an-external-webhook-such-as-make-com/159
There is a small learning curve with Make, which is why I created this basic navigation video to help.
If you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld
Apr 04, 2021 08:13 AM - edited Aug 14, 2023 05:33 AM
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.)
However, I strongly recommend using Make instead of Zapier. Make is infinitely more powerful & flexible & customizable than Zapier, and it is also significantly cheaper as well.
I’ve written an entire post here about Make vs. Zapier.
You can do the exact same thing that I mentioned above with Make, and you can also trigger it with a script instead of a button. Here’s how to do it with a script: https://air.tableforums.com/t/sending-airtable-data-to-an-external-webhook-such-as-make-com/159
There is a small learning curve with Make, which is why I created this basic navigation video to help.
If you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld
Apr 04, 2021 08:35 AM
@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
Apr 04, 2021 08:57 AM
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()
Apr 05, 2021 07:37 AM
@ScottWorld Thanks for the help. Really appreciate it.