Hi, I have written a function that fetches the table value based on the table name and primary field
number = Uf79266972d007f2a3886bf73676860
async function sendContent(number, studentTable, contact) {
const records_Student = await base(`${studentTable}`).select({
filterByFormula: `${contact} = '${number}'`,
view: "Grid view",
maxRecords: 1
}).all();
var td = await totalDays(number, studentTable, contact)
records_Student.forEach(async function (record) {
studentName = record.get("Name")
console.log("Name = ", name)
})
}
sendContent(number, "Students", "UserID")
It gives the following error
AirtableError {
error: 'INVALID_FILTER_BY_FORMULA',
message: 'The formula for filtering records is invalid: Unknown field names: uf79266972d007f2a3886bf73676860',
statusCode: 422
}
But,
If I pass number as 50373. and call
sendContent(number, "Students-2", "ChatID")
It retrieves the name successfully.
Any idea what is causing this issue? the function works for one table but not for the other table where the primary field is a Single text