Table of Contents
Setting up
To retrieve a record you need two things: the baseId
and tableId
. The tableId
is very easy to find: it's just the
name of the tab in your Airtable base.
The baseId
is a bit trickier. You need to go to the Airtable API docs and click on
the base you wish to use. The baseId is something that's immediately shown.
Airtable love
The Retrieve a record
call is 1:1 translated to Flairtable. If you prefer their docs (they're really good):
you can just follow along there.
Remember to use the Flairtable SDK, base URL and API key though!
Usage
To retrieve an existing record, use the find
method.
Any "empty" fields (e.g. ""
, []
, or false
) in the record will not be returned.
In attachment objects included in the retrieved record (Attachments
), only id
, url
, and filename
are always returned. Other attachment properties may not be included.
Code samples
base('YOUR_TABLE_ID').find('RECORD_ID', function(err, record) {if (err) {console.error(err);return;}console.log('Retrieved', record.id);});
You can also omit the callback
parameter. This will result in a 'thenable' promise.
base('YOUR_TABLE_ID').find('RECORD_ID').then(function(err, record) {if (err) {console.error(err);return;}console.log('Retrieved', record.id);});