Feature Update – *page, *startup, and using Airtable with *service
Here’s what’s new: |
Use Airtable as a *serviceAirtable is a user-friendly database system that you can use like a spreadsheet as needed. Some reasons it could come in handy:
Here we explain how to set it up to use with *service, how to add entries to your database (i.e. spreadsheets) from GuidedTrack, and also how to look up (i.e. check) entries in the spreadsheet. 1. To set up Airtable
Go to Airtable.com, create an account, then create a new workspace. You want to avoid using spaces or special characters in the title of your workspace or in any of its tabs (sheets).
2. To integrate a GuidedTrack program with Airtable
Go to the Services tab under Settings, and create a new Service as follows:
(Click the image for a zoomed-in version).
Note that the URL will be different for you, based on your unique Airtable account. In order to get the proper link, go to your Airtable’s API page (we can’t include the link, since that page is unique to your account, but you can find it pretty easily). Also note that you need to find your Airtable API key, which you can access from your Airtable account. (It will likely begin with “key” and then have a random string of case-sensitive letters/numbers.) Note than in this part of GuidedTrack, you need to type “Bearer” before your key.
3. To ADD entries to Airtable from a GuidedTrack program
Use and modify this code based on your own Airtable tab name, column headings, and GuidedTrack variables:
Note that under *path, you’ll include the name of the sheet/tab in your Aitrable database you want to add to (the example here is called AccessCodes).
In this example, the spreadsheet columns are AccessCode, UserType, GroupName and AdminEmail—as partially shown here:
See how the code above sends two variables that have been defined in the GuidedTrack program, named accessCode and adminEmail.
Note however, that for POST requests, any variable in GuidedTrack that isn’t text (e.g., a number, a list) won’t get passed properly to your Airtable spreadsheet, and the entire POST will fail but it won’t give you any error message. The way to fix it is to pass your variables within quotes. For example: Lastly, in our example the variable “posted” was created beneath *success and *error so that you can confirm in the csv of your program whether your attempt to send data to Airtable was met with success or not. You could also let users know the outcome, with something like the following: 4. To CHECK entries in Airtable from a GuidedTrack program
Use and modify this code based on your sheet name, the column you wish to check, and the GuidedTrack variable it pairs with:
Note that under *path, you’ll include the name of the sheet/table in your Airtable database you want to check (just like with adding entries, in this case “AccessCodes” is the name of the sheet). Then, the filterByFormula code tells Airtable what to look up. In this case, we are looking up all entries that have the field AccessCode (singular unlike the plural sheet name, which is also the first column in the screenshot above) equal to the variable tocheck (which was defined in GuidedTrack). Here’s a super handy tool for creating a URL that gets exactly the data you need.
Airtable retrieves the records in a funky way—it’s a list of a list of a list. So, to give an example, this is how you would extract the other fields:
|