At CIBA were huge fans of Airtable. The power of a spreadsheet without the same automation limitations that Google Sheets and Excel can have – and a built in automation tool all in one! Unfortunately, Airtable has not created an easy “send webhook” action in their automation builder… but not to fear! We can send data from Airtable to Zapier / Make through the use of the “Run a Script” action. Here’s how!

STEP 1: Setup your workflow

Setting up a simple workflow in the Automations module in Airtable is pretty straightforward. As with any other automation system you will start with a trigger (in Airtable’s case the triggers are limited to Airtable based (such as “record created), schedule drive (on the clock), an inbound webhook, or one of the two integrated trigger partners (Google / Outlook)

At the point in which you want to send out data to Zapier / Make (or any other system that will accept a webhook input without authentication) – add the “Run a Script” action.

Once you add the action, the code editor will open up with some dummy code already written that looks like this

console.log(`Hello, ${base.name}!`); 

Don’t be afraid! Any low-code / no-code automator should be able to follow along with this simple script were going to give you.

Step 2: Add the webhook script

Lets replace that dummy code with the following:
let config = input.config();
let url = `https://the_webhook_url_goes_here.com?`;
fetch(url);

For the webhook URL – you will want to use the trigger action in the automation tool you are sending it to such as the “Catch Hook” action in Zapier.

make sure to put the whole URL inside the single quote marks ‘ ‘ and don’t forget to add the question mark at the end, as that will seperate the URL from the data that

 

Step 3: Add data to send in the webhook script

Sending a blank webhook generally isnt that useful, so we want to add data from our Airtable base into the URL to send along with it.  To do this we are going to put together some data “pairs”. A pair is two parts:

  1. What we want the receiving system to call the data
  2. What we call the data in Airtable

how does a data pair look in the code? Like this:

NameOfThing=${config.AirtableDataName}

In this example – the “NameOfThing” in the beginning is (#1) – what we want the receiving system to call the data and on the right we have the name of the Airtable field we are sending (#2).

These names are all pretty arbitraty – we get to define them ourselves so dont worry too much about what you call things. The most important part is to name them something you will remember. Often the name on the left and the name on the right are the same like

email=${config.email}

Where we are sending over an email address from an Airtable record. So if we wanted to put these together to finish the code to send just the email address to the webhook it would look like this:

let config = input.config();
let url = `https://your_webhook_address.com?email=${config.email}`;
fetch(url);

If you want to add more than one piece of data – just add an & symbol after each data pair and you can put in as many as you want! Here is an example where we are sending a name, email and Airtable record ID:

let config = input.config();
let url = `https://your_webhook_address.com?RecordID=${config.myRecord}&email=${config.email}&name=${config.name}`;
fetch(url);

Step 4: Map your input variables
Youll notice on the left hand side of the screen a section called “Input Variables”. This is where you tell Airtable what all of your #2 data should be. For each pair of data you should have a “name” and a “value” on the left. The name is the #2 value (the one that goes on the right side of the pair in the url) and the value is where you can map data from your airtable base (or a previous step).
Once you have this all setup, make sure to run a test and make sure the data looks right at the receiving end. Need help? Drop us a note at help@canitbeautomated.com!