I’m working with Airtable’s Node.js SDK and running into a frustrating issue. My app checks if a booking already exists before creating a new one, but sometimes the search fails to find existing records.
Here’s my lookup function:
findBookingByReference: async (refNumber) => {
let bookings = await reservationBase('Bookings').select({
view: 'All Records',
filterByFormula: `{Reference Number} = "${refNumber}"`,
maxRecords: 1,
}).all();
return (bookings.length > 0) ? bookings[0] : null;
},
And here’s how I use it:
let existingBooking = await findBookingByReference(booking.reference);
if (!existingBooking) {
addNewBooking(booking);
} else {
modifyExistingBooking(booking);
}
The problem is that sometimes the API returns nothing even when I know the record exists. This causes my code to create duplicates instead of updating existing entries. Has anyone experienced similar reliability issues with Airtable queries? Could this be related to timing or API rate limits?