Sébastien Lucas / Dev wiki
  • Blog Wiki
  • Story book
  • Developers comics
  • Angular
    • Angular CLI + Angular.json
    • ngTemplateOutlet
    • Angular Schematic
    • Interceptor
    • Micro frontend + Mono repo
    • Build a library module
    • Error handling
    • Virtual and infinite scroll
    • Angular i18n
    • Debug Angular
    • Angular LifeCycle Hook
    • Nested forms in Angular
    • Angular Recipes
    • Master component in Angular
    • Perfomance optimization
    • Service Workers + PWA
    • Mobile
    • Electron app / Desktop app
    • Unit test & Angular
      • Unit test recipes (Jasmine / Karma / Angular)
      • Testing services with httpMock
    • Communication between components
    • Angular snippet library
    • Release and version management
    • Angular tutorial selection
    • UI components libraries
    • Angular libraries
    • Angular Tutorials
    • NGRX
      • Angular NGRX / Tips and code examples
      • Angular new Redux (alternative to ngrx)
      • NGRX unit test
      • Angular ngrx / Basics
    • Angular 2/Angular 1 differences
  • Graphql
  • Three.js
  • Ag grid
  • Open source BIM and 3D
  • Javascript
    • Null vs undefined
    • Html API
    • Await API
    • Debug memory leaks
    • Offline and PWA
    • Javascript tutorials
    • Javascript recipes
    • Bluebird missing docs
    • Alternative to lodash with ES6
    • ES6 syntax the best parts
    • Vanilla JS
  • RXJS
    • Docs
    • Recipes
    • Mock API and sandbox
    • Observables rxjs recipes
    • Combination operators
  • NODE.js
    • Environment variables
    • Fix CORS
    • Pagination requests in API
    • API tests
    • Node.js security
    • Learn node.js
    • Best libraries for node.js
    • Mongoose recipe
    • Debug node.js
  • Gatsby / React
    • Hooks
    • React concepts
    • Gatsby internationalisation
  • Ghost blog
  • Services for developers
    • SaaS images services
    • Airtable API examples
  • MISC
    • JIRA debugging
    • Wordpress plugins
    • Interview Sébastien Lucas
    • English expression
    • True recipes
    • Science podcast
  • AI
    • Machine learning open source
    • Tensor flow
    • Machine learning
    • Code examples
    • Courses and tutorials
    • Datasets
    • The Future of AI
    • Learn algo and data structures
  • Typescript
    • Generic types
    • Typescript recipes
    • Advanced types
      • Conditional types
      • Type guards
    • d.ts files
  • Docker
    • Starting with docker
    • Dockerise simple node app
    • Docker by aymen el amri
  • Mongodb
    • Pattern and data modeling
  • Devops
    • Heroku
    • Scaleway
    • Github template
    • Gitlab CI
    • http2
    • nginx
    • zsh
    • CI Continuous integration
    • DNS
    • Devops resources
    • Gcloud useful commands
    • Authenticate Gcloud
    • Documentation generators
    • Firebase database
  • Developers ressources
    • Online platform coding
      • Online courses
      • Coding games
      • Coding test platforms
      • Links to check
    • Good developers blogs
    • Nice open source project / github
  • Tooling
    • The chrome urls
    • Linux Mac tips
    • Webstorm configuration
    • Develop in Windows
    • Mac debug hardware
    • Mac Setup for a developer
    • Chrome extension
    • Develop toolbox
  • HTML / CSS
    • Tailwind
    • Css grid
    • ☘️Nice styles & generators
    • Favicon
    • Flexbox grid
    • Flexbox layout
    • PUG templates tips
    • Html and css references
    • Css snippets
    • SASS-CSS libraries
    • New things in scss
    • SASS best practices
    • Style lint
  • Tests
    • Cypress
      • Learn cypress and more tests
      • Cypress commands
      • Cypress plugins
      • Page object && app actions
      • Flaky tests
    • Mobile test
    • BDD + Cucumber
    • Puppeteer
    • Type of tests + Ressources
    • Jasmine test
    • Mock, fake, stub in unit tests
    • E2e tests with protactor
    • Mocha
  • REVIT & AEC tools
  • Git
    • Git commits
    • Git tips
    • Git hooks
    • Set up a mono repo
  • Design Pattern
    • Functional Programming
  • Job board / Remote jobs
  • SVG
  • JSON
  • Github
    • Forking a github repo
  • NPM
    • Private NPM packages
    • Publish to NPM with np
  • Yarn
    • Yarn evolution / 2, 3...
    • Yarn Linking
Powered by GitBook
On this page
  • Where to find documentation about Airtable API ?
  • Airtable API usage examples
  • Filter a list by a related field

Was this helpful?

  1. Services for developers

Airtable API examples

PreviousSaaS images servicesNextMISC

Last updated 6 years ago

Was this helpful?

Airtable is an interesting tool for web developer as it is as the crossroad of database ui like phpmyadmin, robotmongo, a spreadsheet like google spreadsheet and an api.

You can use airtable as an api in a nobackend strategy. Even if you end up using other data storage. It is a good way to start prototyping with true data. Its simplicity allow all team members even non technical to participate.

You can create your .

Where to find documentation about Airtable API ?

The main documentation is in your Airtable App and contextual to your data.

  • Click on the contextual menu

Airtable API doc
  • Then a documentation screen show up relevant to your database settings

Airtable API usage examples

Let's look at some nice uses of airtable API.

In all examples {tableId} is to be replaced by your table Id. And {DatabaseId} by your database Id

  • Limit number of items per page

    To do pagination

https://api.airtable.com/v0/{DatabaseId}/{TableId}?pageSize=1

  • Filters items with a title equal to a defined value

    Exact title match

https://api.airtable.com/v0/{DatabaseId}/{TableId}?filterByFormula={title}="Ternes"

  • Filters records using a math function on one of their number field

    We want to display records with a currency field "cost" superior to defined amount

https://api.airtable.com/v0/{DatabaseId}/{TableId}?filterByFormula={cost}>1000000

Filter a list by a related field

A related field relates 2 tables. Let's take an example.

A project table and an architect table. The "architect" field in the "project" table refer to the architect that have designed the project. An architect tables show more details on this architect.

The problem is that in the api the output of a related field is an array of the related records ids.

So I wandered if the query was something like

But it seems that is not the case, as the api always return this error mesage.

{
  "error": {
    "type": "INVALID_FILTER_BY_FORMULA",
    "message": "The formula for filtering records is invalid: please check your formula text."
  }
}

I am listing all projects of architects. I want to click on one architect name to have this list limited to only his projects. As we have just seen, I need his name to do the filtered projects request.

But now how to get the record name from the table query ? As I need it to make the query. Should I first hit a request to get all architect information, before making a request for his projects.

Lookup fields allow to list in the projects query a field of a related field table. As we need architect's name, we are going to choose architect table and name field. And that's it we have both the id and the name of the architect in our first project call.

Great !

So now the question is is there a way to query directly a list limited by one of it's related fields id? Which would be much more natural for a developer. Well I do no know yet :)

![airtable3.png]

A (feb 2016) to the api client

a allowing to quickly url encode parameters (to play along with post man rest api client)

Related fields in airtable
Filter by formula

I've posted an on airtable.js client to know more about it. But after trial and error, tried with the name of the linked record (not it's id) and it worked !

Filter by formula 2

There seem to have a solution with the lookup fields

Lookup airtable fields
blog post explaining some changes
codepen
issue
free account
Airtable contextual doc
lookup fields