Apr 02, 2024 07:57 PM
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? 😕
Solved! Go to Solution.
Apr 02, 2024 09:41 PM
Hello @andy_m
Instead of use
{project_id}="3986271"
Use this approach.
AND({project_id}='your project id')
👍
Apr 02, 2024 09:41 PM
Hello @andy_m
Instead of use
{project_id}="3986271"
Use this approach.
AND({project_id}='your project id')
👍
Apr 03, 2024 07:34 AM
thanks!