Skip to main content
Solved

filterByFormula returns nothing (node.js) but results everywhere else

  • April 3, 2024
  • 2 replies
  • 55 views

Forum|alt.badge.img+4
  • Participating Frequently

This forum has been incredibly helpful, so I thought I'd keep asking questions. 
Next up is why filterByFormula doesn't seem to work in my node app. However, the formula works in the Airtable UI and when used in an HTTP request via the API. 

 

const base = new Airtable({ apiKey: 'xxxxxx' }).base('yyyyy'); const matchingRecords = []; await base('tblbfJeKQo52GnLWD') .select({ filterByFormula: '{project_id}="3986271"' }).eachPage( (pageRecords, fetchNextPage) => { pageRecords.forEach(record => { console.log(record); matchingRecords.push(record); }); fetchNextPage(); }, err => { if (err) { console.error(err); return; } } ); console.log(matchingRecords);

 

The above returns `matchingRecords` as an empty array. 

However, 

 

https://api.airtable.com/v0/app49uIs2F0Ca2ES3/tblbfJeKQo52GnLWD?filterByFormula={project_id}='3986271'

 

returns a result as expected.

The formula also returns true in the AirTable itself..

 

What am I missing? 😕😕 

 

Best answer by dilipborad

Hello @andy_m 

Instead of use 

{project_id}="3986271"

Use this approach.

AND({project_id}='your project id')

👍

2 replies

dilipborad
Forum|alt.badge.img+23
  • Brainy
  • Answer
  • April 3, 2024

Hello @andy_m 

Instead of use 

{project_id}="3986271"

Use this approach.

AND({project_id}='your project id')

👍


Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • April 3, 2024

thanks!