Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

How to retrieve more than 100 records ? I have a NodeJs API attached with this please tell the necessary changes i have 200+ records and want to retrieve all of them in one go

Topic Labels: Sync
930 1
cancel
Showing results for 
Search instead for 
Did you mean: 

please help me with this.
Any type of help is highly appreciated.
require(“dotenv”).config();
const Airtable = require(“airtable”);
const base = new Airtable({ apiKey: process.env.API_KEY }).base(
" "
);
const express = require(“express”);
const cors = require(“cors”);
const bodyParser = require(“body-parser”);
const app2 = express();
app2.use(cors());
app2.get("/featuredPaths", (req, res) => {
console.log(“query params::”, req.query);
var remOrLoc = req.query.remOrLoc;
var skill = req.query.skill;
var site = req.query.site;
var skillnew = req.query.skillnew;
var country = req.query.country;
var vetted = req.query.vetted;
var limit = JSON.parse(req.query.limit || 100);
// var formula = “FIND(’” + sitename + “’,Sitename) > 0”;
var formula =
“SUM(FIND(’” +
remOrLoc +
“’, Remote_or_Local) > 0, FIND(’” +
skill +
“’,Skills) > 0,FIND(’” +
skillnew +
“’, skills_new) > 0,FIND(’” +
site +
“’, Sitename) > 0,FIND(’” +
country +
“’, Country) > 0,FIND(’” +
vetted +
“’, Vetted) z> 0)”;
var recordSet = ;
var base = new Airtable({ apiKey: " " }).base(
" "
);
base(" ")
.select({
maxRecords: 300,
view: “Grid view”,
filterByFormula: formula,

})
.firstPage(function (err, records) {
  if (err) {
    console.error(err);
    return;
  }
  records.forEach(function (record) {
    console.log("result===============>", result)
    var result;
    //console.log("Retrieved", record.get("Id"));
    //console.log(record.fields);
    // var result = {
    //   title: record.fields.title,
    //   courseUrl: record.fields.courseUrl,
    // };
   recordSet.push(record.fields);
   console.log(recordSet);
   // recordSet.push(result);

  });
  res.json(recordSet);
});

});

app2.listen(process.env.PORT, () => {
console.log(“Airtable app listening on port port!”, process.env.PORT);
});

1 Reply 1

Hi @Shivam_Solanki, and welcome to the community!

There are a number of articles here that deal with exactly this issue such as this one, and this one.