Hello! I am in desperate need of help. I can't figure out how to "filterByFormula" in the following script. I am trying to send a JSON payload via webhook to MAKE.com. I only want to send records where a given field is blank. I have tried multiple variations of the filter but can't figure out why it always sends EVERY record.
let table = base.getTable("BA Aggregated Calendar 2022-2023");
table.selectRecordsAsync({
fields: ["Event ID", "Outlook Category", "Users"],
filterByFormula: "blank(Outlook Category)",
sorts: [
// sort by "Users" in ascending order...
{field: "Users"},
]
}).then(query => {
const payload = {
records: query.records.map(record => ({
id: record.id,
eventID: record.getCellValueAsString("Event ID"),
outlookcategory: record.getCellValueAsString("Outlook Category"),
Users: record.getCellValueAsString("Users")
}))
};
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
};
fetch('webhookhere', options);
});