Developers

Connect Airtable

Send an Airtable table of people to your event with an automation script.

← Back to Developers

Send people from Airtable

  1. In Airtable, make a table called Attendees with the fields Email, First Name, Last Name, Job Title and Company.
  2. Choose Automations, add a trigger (such as When a record is created, or a button), then add a Run a script action. The Scripting extension works too.
  3. On the left of the script editor, add two input variables: apiKey (paste your key as its value) and eventId (paste your event id).
  4. Paste the script below and choose Test.
const { apiKey, eventId } = input.config();
const table = base.getTable("Attendees");
const result = await table.selectRecordsAsync({
  fields: ["Email", "First Name", "Last Name", "Job Title", "Company"],
});

// Airtable field -> Shoal field. Empty cells are left out, so they never clear anything in Shoal.
const fields = { "Email": "email", "First Name": "first_name", "Last Name": "last_name",
  "Job Title": "job_title", "Company": "company" };
const people = result.records
  .map((r) => {
    const person = {};
    for (const [from, to] of Object.entries(fields)) {
      const value = r.getCellValueAsString(from).trim();
      if (value) person[to] = value;
    }
    return person;
  })
  .filter((p) => p.email);

for (let i = 0; i < people.length; i += 500) {
  const response = await fetch("https://shoalevents.com/api/v1/events/" + eventId + "/attendees", {
    method: "POST",
    headers: { Authorization: "Bearer " + apiKey, "Content-Type": "application/json" },
    body: JSON.stringify({ attendees: people.slice(i, i + 500) }),
  });
  if (!response.ok) throw new Error(await response.text());
}
output.set("sent", people.length);

Empty cells are skipped, so they never erase anything in Shoal. Run it again whenever your list changes: people already in Shoal are updated, not added twice.

Bring attendees back into Airtable

You can also read attendees into Airtable with a GET request to /events/EVENT_ID/attendees, for example to see who has registered or checked in. Fetch up to 500 at a time with limit and offset until you have the total (the Google Sheets script shows how).

Plan Your Next Event on Shoal

Your first 2 events of up to 50 people are free if you create them before January 1, 2027. Set up in an afternoon.