Skip to main content

New to Airtable and testing out scripting blocks, need some insight on understanding the Airtable specific Classes and Methods

  • June 23, 2020
  • 2 replies
  • 21 views

Hi everyone,

I really like Airtable and the fact there is a community forum is amazing! I found this example https://github.com/nicroto/airtable-scripts/blob/master/update-stock.js and I’m trying to play around with it in the code editor. Although I’m stuck on nomenclature. With base.getTable, do I use the name of the base? I’m getting an error even trying to run the example. Thank you in advance for any and all help.

2 replies

Forum|alt.badge.img+19
  • Inspiring
  • 3263 replies
  • June 23, 2020

Hi Devon, and welcome to the community!

No.

As indicated in the docs, a Base provides an entry point to all of the data in a given base. There is only ever one base available — the base that’s open and in which your scripting block is written or installed. It can be accessed via the base global variable.

As such, a simple snippet like this … opens the “Airdrop” table and reads all of the records into an object.

let table = base.getTable ("Airdrop"),
    records = await table.selectRecordsAsync ();

The next line allows you to inspect the records object. The rest is uphill all the way, like golf. :winking_face:

output.inspect(records);


  • Author
  • New Participant
  • 1 reply
  • June 23, 2020

Hi Bill,

Thank you for the welcome and thank you for the response! I’ll work on this.