How to create a tool library in Airtable

Daniel Wirtz

1 year ago1 min read

Airtable is great to structure a lot of data. In this video I'm showing how we created a Tool Library at the Facilitator School. To save us time, I wrote a small script that fetches helpful metadata from Brandfetch

You can find the script here:

Get Brandfetch Metadata

1let table = base.getTable("Tools");
2let record = await input.recordAsync('Pick a record', table);
3
4if (record) {
5 output.text(`You picked ${record.getCellValueAsString("Name")}`);
6}
7
8var myHeaders = new Headers();
9myHeaders.append("x-api-key", [YOUR_API_KEY];
10myHeaders.append("Content-Type", "application/json");
11
12var raw = JSON.stringify({
13 "domain": record.getCellValue("URL")
14});
15
16var requestOptions = {
17 method: 'POST',
18 headers: myHeaders,
19 body: raw,
20 redirect: 'follow'
21};
22
23let response = await fetch("https://api.brandfetch.io/v1/company", requestOptions);
24
25const responseJson = await response.json()
26
27console.log("responseJson →", responseJson)
28
29await table.updateRecordAsync(record, {
30 "Description": responseJson.response.description,
31 "Instagram URL": responseJson.response.instagram.url,
32 "LinkedIn URL": responseJson.response.linkedin.url,
33 "Youtube URL": responseJson.response.youtube.url,
34 "Twitter URL": responseJson.response.twitter.url,
35 "Name": responseJson.response.name
36})

Subscribe to my newsletter

Helpful tools, thoughtful articles and other findings from the web. From my desk to yours.