What you'll learn:

  • How to send information from your project to Airtable
  • How to use the Endpoint Tool to test whether your requests are working successfully.

Intro:

In our last tutorial, we learned how to set up Airtable and retrieve data from it. In this tutorial we'll learn how to update data on the table.

Why would we want to do this?

Updating data on our spreadsheets makes it possible to store key bits of information like the time your users complete actions and storing the choices they make to learn how to make better skills.

Getting Started:

I'm going to assume you already have an Airtable account for this tutorial,. If not, please head to the previous tutorial and go through set up.

Lets first set up a new project. I started a blank spreadsheet and filled it with my own values as shown below:

Follow this link to generate your API key if it's your first time using Airtable:
https://airtable.com/account

This is where you click "Generate API key"

Next I'm going to head to this link:

https://airtable.com/api

Select your project from the list of projects.


Once we've done this, we should be on the following page.


This page is going to be very helpful for putting together our API calls.

In the top right corner, select the "show API key" button.

Make sure to select this checkbox. It'll make it so all the links following will have the API key for your account. This will let you and only you change values on your spreadsheet.

Lets take a look at the left bar. This will help us out with whatever action we want to do to access our spreadsheet. 

On the right, we see the information we need to get our API calls working.
In the picture below, we have some information that will help us update a value in our spreadsheet. 

We have a few bits of relevant information here,

-XPUT:

This is letting us know what type of request we are doing. In this case, it is a PUT request that will let us update our spreadsheet.

https://api.airtable.com/v0/app5y0nsnMRpEqKWd/Table%201/recPZgnoOd32W1XkG

This is the endpoint that we'll be pointing to.

Authorization: Bearer keyM6ZYJYmkN5p0vt
Content-Type: application/json

These are the headers that we'll be using in our API block. You can see my key above but note that this is strictly for demonstration purposes. This bearer key is like a password. Do not share your api key with anyone unless you want to let them change values on your spreadsheet.


-d '{  
    "fields": {  
      "Name": "Andrew",
      "Notes": "Loves cookies"
  }
}'

This is the content of our body. We're only going to use the values between the braces.


Now lets head over to Voiceflow and set up our API block with the above values. 

Note that we're using the PUT request from the drop down and filled in our Headers with the values in posted above.

In our body tab, we need to copy and paste the values in the -d field from our airtable API page. Make sure to only include the braces and the values inside them. You can not include -d or quotation marks in this field.

When we run our API call and test it with the debugger on inside Voiceflow, we see that the request went through and returned a response. This means that the Airtable understood our request and our request succeeded!

 

If we head back to our Airtable spreadsheet, we can see that the value for "Andrew" has been updated to "Loves Cookies".

And thats it! We've made it to the end and we can now update our values as we need.

Did this answer your question?