This snippet makes a list of all records from a single table in an Airtable base.
It is recommended to look at the original snippet for better understanding of how this system works.
{note}{formtext: name=apikey} {formtext: name=base}{endnote}
{if: apikey <> "" and base <> ""}{urlload: https://api.airtable.com/v0/{=base}/VWB?fields[]=Workflow+Title; method=GET; done=(res) -> ["listresponse"=catch(fromJSON(res), "???")]; headers=Authorization=Bearer {=apikey}}
Data received
Count of records received: {=count(listresponse.records)}
Record IDs obtained: {rec_ids=map(listresponse.records, (x) -> x.id)} {=rec_ids}
Form menu: {formmenu: values={=rec_ids}; name=chosen_record_id}
Fetching record data:
{urlload: https://api.airtable.com/v0/{=base}/VWB/{=chosen_record_id}; method=GET; done=(res) -> ["response"=catch(fromJSON(res), "???")]; headers=Authorization=Bearer {=apikey}}
TC: {=response.fields["TC"]}
Buyer Full Name: {=response.fields["Buyer Full Name"]}
{else}
Enter apikey and base to proceed
To get the apikey, generate it on your Airtable account page (keep it a secret)
If you have the record URL as: https://airtable.com/appW0YBv9zvXFQcO6/tblHDV2wc3yp0T7IQ/viwqYnynm1ysWpg6Y/recltLpNVfdtUlVtB?blocks=hide, then base=appW0...Qc06, and recordid=rec...VtB.
For an interactive demo of Airtable's API, visit their API page and choose your base. On the left you should choose "VWB Table" and then "Fields", "List records" or "Retrieve a record". On the right you will see various outputs relevant to your base.
{endif}