Home / All Integrations / Airtable

Connect Airtable to your chatbot

Use Airtable as a database


In order to use this library, you need to create an account on airtable, free accounts provide sufficient rights to use the API and are good enough to get started.

IMPORTANT
Once you have created your first spreadsheet, you will need the spreadsheet API ID and the table name.

To find them:

do records = Fn("airtable", spreadsheet_id="MY_SPREADSHEET_ID", table_name="AN_AWESOME_TABLE", method="getRecords")

Methods

The target spreadsheet ID and table name must be passed to all functions.

Create a new record

A record on airtable is similar to a row in excel. To create a new record, simply pass to the function an object with the fields and values as follows:

  • You can select which fields you would like with the fields parameter.
  • Formulas are to be passed in the filterByFormula parameter. Here we get all the rows that have a field job not empty:
do fields = {
  "firstname": "Bastien",
  "email": "bastien@csml.dev",
  "job": "COO"
}
do newRecord = Fn("airtable", method="createRecord", spreadsheet_id="MY_SPREADSHEET_ID", table_name="AN_AWESOME_TABLE", fields=fields)

Get records

You can get an array of records from Airtable, and you can also pass a query to filter the rows.
More information about Airtable formulas: https://support.airtable.com/hc/en-us/articles/203255215-Formula-Field-Reference

do fields = ["firstname", "email"]
do filterByFormula = "NOT({job} = '')"
do records = Fn("airtable", method="getRecords", spreadsheet_id="MY_SPREADSHEET_ID", table_name="AN_AWESOME_TABLE", fields=fields, filterByFormula=filterByFormula)

Discover similar integrations:

Amazon Dynamodb

Many more integrations are coming!

If you have a cool integration in mind, drop us an email on contact@csml.dev and tell us all about it!

Many of our 43 currently available integrations come directly from your suggestions!

Join the Community
on Slack Slack

Come and learn all about CSML with other chatbot enthusiasts on the Slack CSML Community! ūü§ó