Airtable Integration

Catherine Maddock
Catherine Maddock
  • Updated

How do I connect Voiceflow with Airtable? How do I connect Voiceflow with my spreadsheet or database?

Many Voiceflow users & conversation designers leverage Airtable as a spreadsheet/database to integrate within their Voiceflow conversations or assistants. In this doc we are going to walk through: 

  1. How to set up an AirTable 
  2. How to connect an AirTable to a Voiceflow assistant 
  3. How to take information from an Airtable to add to an assistant 
  4. How to add information to an AirTable from an assistant 
  5. Frequently Asked Questions

How to set up an AirTable

Step 1: If you don't already have an AirTable account you'll want to start off by heading over to airtable.com and clicking Sign up for free to create an account.

Step 2: Once you have signed up or logged in head to the main page where you can either  (A) start a new spreadsheet from scratch or (B) import an already existing spreadsheet (i.e. from Google Sheets or Microsoft Excel) 

mceclip0.png

Step 3: Make sure all needed information is in your spreadsheet including headers. 

 

How to connect an Airtable to a VF assistant

Step 1: Add an API block to your VF assistant 

Step 2: Choose either GET or POST

  • GET grabs information from your AirTable puts it in your assistant (Example: User wants to know what the next task on the list is)
  • POST adds information to your AirTable that was gathered from your assistant (Example: User wants to add a task to their to do list)

Step 3: Once your spreadsheet is ready (you can make changes at anytime) click the Help button on the top right hand side of your page

mceclip1.png

Step 4: Click API documentation at the very bottom of the Help tab 

Step 5: Grab the curl from the API documentation under AUTHENTICATION and paste into the URL line of your API block

mceclip3.png

mceclip4.png

** this example is using GET but it's the same url for POST

Step 6: Get your API/bearer key 

  • To show your bearer key click show API key in the top right hand corner of the API documentation
  • If you don't have a key yet visit your account page that will be linked in the api document 

mceclip23.png

  • Once you have your key copy it

mceclip7.png

Step 7: Add bearer key to your API Block

  • Under headers, label the first line "Authorization" 
  • The second line paste your authorization key 

mceclip8.png

 

Getting information from your AirTable 

In this demonstration example I have set up an AirTable that has a to-do list of tasks.

Step 1: Make sure you have selected the GET option

Step 2: Click Send Request and locate the information you want from your AirTable

  • 200 OK means your integration is working
  • In this example I'm looking for "Tasks" 

mceclip10.png

  • You want to find any lines of information you want to share with the user of your application

Step 3: Map out to a variable

  • In this case the variable is going to be task 
  • to start the mapping out process we need to let the API know where the information we want is 
  • this will look like [response.record[0].fields.Task]
    • Response: is the whole thread that is created when you click "Send Request" 
    • Record: Is anything written in your AirTable 
    • Fields: Letting the API know that the AirTable is divided up in fields  
    • Varible: in this case is Task, is the specific header you want to grab information from 
  • You want to map to from least specific to most specific information! 
  • This goes in the first line of Capture Response in your API block

mceclip11.png

Step 4: Create the variable 

  • There is a second line under Capture Response where you are prompted to add a variable 
  • in this example we are going to use {Task} 
  • The variable I used to share the information grabbed from the API with the user
  • The variable can be anything 

Step 5: Add more blocks to your assistant 

  • The block following the API block in this example says "Your next task is {Task}" 
  • When tested the chat bot says "Your next task is Grocery shopping" which is the first task in this demo's AirTable 

mceclip12.png

mceclip13.png

Step 6: repeat steps 2 -5 for every line of information you want to collect 

  • for example, you could map to id or created time 

 

Adding information from your assistant to your AirTable 

Step 1: Make sure that you have selected the POST option 

Step 2: Add a new set of headers after authorization like so: 

mceclip19.png

Step 3: Go to your API documentation fro AirTable and navigate to the Create records section 

Step 4: Copy everything after data

mceclip14.png

Step 5: In your API block click the + next to Body and then select Raw. Your screen should look like this: 

mceclip15.png

Step 6: Paste what your copied from the API document into Body

mceclip17.png

Step 7: Clean up the code

  • The goal is to put new information into the Airtable - everything that is in this body is already in the spreadsheet 
  • In this demo we want to collect new tasks for the spreadsheet, meaning we don't need two Task fields 
  • We can start by deleting the second Task field. Now the body looks like this: 

mceclip18.png

  • We want to collect tasks so we are going to add in a variable called {new_task} to replace grocery shopping 

mceclip20.png

Step 7: Test your integration 

  • Click Send Request
  • It will prompt you to put in a test variable, here I'm putting in "buy milk" as a new task to add 
    mceclip21.png
  • If the test I successful the varible you put in will pop up in your AirTable 

Step 8: Repeat steps 3-6 for all variables of data you want to collect 

Step 9: Use a choice step to collect the data from the user for the variable. Here's an example flow: 

mceclip22.png

 

Frequently Asked Questions 

When I send a request, I get a VF_STATUS_CODE": 422 error. What do I do?

 

There are a few ways to debug this status

  • Confirm that the information that you're sending to the Airtable is formatted correctly. Make sure that "records" and "fields" are exactly the two outer text key values, the column titles match the Airtable column titles exactly, and the column values match the Airtable expected data type
{
"records": [
{
"fields":
{
"column_title1": "hello",
"column_title2": "goodbye"
}
}]
}

 

 

 

Was this article helpful?

1 out of 11 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.