Copy of Snippet "Airtable record lister"

Grab all record IDs from an airtable base and then select from one of them using a formmenu.

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) -> ["url_response"=catch(fromJSON(res), "???")]; headers=Authorization=Bearer {=apikey}}
Data received
{records=catch(url_response.records, [])}
Count of records received: {=count(records)}
Form menu: {formmenu: values={=records}; name=chosen_record; itemformatter=(value) -> value.fields["Workflow Title"]}
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}

1 Like

Hi Gaurang,

I am trying to use this snippet. As far as I understand I need to put API and Base Id. What else do I need to change in your snippet to work with my base id?

When I try to execute this snippet, it does not retrieve any records.
Do I need to change anything in following URL?
{urlload: https://api.airtable.com/v0/{=base}/VWB?fields[]=Workflow+Title; method=GET; done=(res) -> ["url_response"=catch(fromJSON(res), "???")]; headers=Authorization=Bearer {=apikey}}

I am sorry but I hardly have any technical knowledge on how it works.

Happy to help :slight_smile: And no worries of technical knowledge. You only have to change all occurrences of tables names and column names in the snippet.

In the particular line you sent, you need to change VWB and Workflow+Title in the command.

If I remember correctly, VWB is the table name and Workflow Title is the column name. (if the column name has spaces we change it like so: Workflow Title -> Workflow+Title)

I hope that helps.

1 Like

Thank you so much Gaurang. This worked perfectly. I can properly retrieve all the records from airtable. I will get back to you in case if I need any help.

I wish I can understand all these codes and other technical things.

1 Like

Do keep experimenting and post in forum whenever you need help! :slight_smile:

Hi Gaurav,

If airtable field has multiple records, can I use that filed as drop-down and use one of the choice out of it in snippet?

Thanks

Hi Gaurang,

I tried retrieving records from a field which is linked field to another table. It shows me some record id but not the actual value.
image

Is there any possibility wherein I can get actual value? In my case, each record is name of person.

Hey Pratik, I think this functionality is the primary purpose of the linked snippet. If I run it I am shown multiple records as dropdown and I am allowed to choose one.

Yes I have also made a snippet for that previously :slight_smile:

Notice carefully that this snippet has two urlload commands. The second urlload command will resolve additional information about the record id, which in your case are next to the "List of Directors".

As before, you'll need to carefully change the table names and column names to match your scenario.

Okay, didn't realize that the snippet I linked to and this snippet are the same :stuck_out_tongue:

Please do try it out and feel free to share your snippet if it doesn't work/doesn't give the right output and I'd be happy to debug it.

Hi Gaurang, Thank you for this. I guess I understood this point and I have already achieved this.
However, if you see my last query I am trying to get a field which is relation column in Airtable. So I am not getting the value, instead it shows only the record id.

Any solution please

EDIT: I got this worked. Actually, I created another lookup column in Airtable from this relation column and fetched this new column in Textblaze.

Thank you for all your help.

1 Like

Hi Gaurang,

Sorry to bother you again and again.

I could successfully retrieve linked record (which has multiple records) as dropdown, the values are coming from another table. Now I want to retrieve related details of this selected value from another table? Any idea how can we do this.

Hi Gaurang,

After searching in forum, I got this working. @Cedric_Debono_Blaze's this post helped to locate the position of value in the list and I extracted the related information based on this location.

1 Like

@Pratik_Shah awesome! Glad you managed.

Of course, always happy to answer any other questions you might have.

1 Like

Yes, the more I am digging, the more ideas are coming in mind. Ultimately, I am learning good things.

1 Like

I've been using Text Blaze for over 2 years and I'm still learning new stuff :grin:

2 Likes

That's true

1 Like

Hi @Gaurang_Tandon, I just realized that, this api is pulling only 100 rows from many. Are you aware about any such limits from Airtable side or may be from Textblaze side?

Thanks

Yes, there is a 100 row limit from Airtable's side and we cannot override it :frowning: I have tried to work around that using multiple urlload commands but it doesn't work very well.

1 Like

Oh! that's sad.
Do you have similar solution for Google Sheet? This airtable snippets was ultimate solution for me, solves many of my problems. If we can do similar thing via google sheet, that would be great.