Adding a little more context. I believe it is randomly returning the error on the table.find
call
base('MOS Card Data').select({
// Selecting the first 3 records in CMT: Client View:
view: "Tech: All English MOS",
pageSize: 3,
// maxRecords: 1,
}).eachPage(function page(records, fetchNextPage) {
console.log(records.length)
records.forEach(function(record) {
const table = base("Popular Searches Filter");
const filters = record.get('Popular Searches Filter');
const mosCode = record.get("mosCode");
console.log('attempting to write out MOS code: ' + mosCode);
console.log(filters)
if (filters !== undefined && filters !== '') {
filters.forEach((item, index) => {
table.find(item, (err, rec) => {
try {
if (err) {
console.log(`***************** BAD MOS CODE: ${mosCode} **********************`)
console.error(err)
return
}
const term = rec.get("Search Term");
const output = `${filterMap[term]}\n`;
console.log(`${mosCode}`)
fs.writeFile(`./mos-filters/${mosCode}.json`, output, { flag: "a+" }, (err) => {
if (err) throw err;
});
} catch (err) {
console.log(err)
}
});
});
}
});
fetchNextPage();
}, function done(err) {
if (err) { console.log('**************** bad fetch ******************'); console.error(err); return; }
});
bumping, looking for a possible solution as this is core functionality to the API
bumping, looking for a possible solution as this is core functionality to the API
I get the same error message.
I am sorry, stuck with the same issue on my node app, could you please advise if you've got a chance to resolve this?