Hi everyone,
I’m performing a vlookup essentially at a spesific time each day. It worked the first couple of times, but now keeps giving me an error, any advice/guidance would be greatly appreciated!
//"Time Sheet" contains values on which you want to run the vlookup
let mainTable = base.getTable("Time Sheet");
let mainTableRecords = await mainTable.selectRecordsAsync({fields:["Title Name"]});
//"Volunteers" contains range to search in
let lookupTable = base.getTable("Volunteers");
let lookupRangeRecords = await lookupTable.selectRecordsAsync({fields:["Name"]});
//"Title Name" has the values you want to look up
for (let record of mainTableRecords.records) {
let lookupValue = record.getCellValue("Title Name");
//"Name" is the range to search in
for (let rangeRecord of lookupRangeRecords.records) {
if (rangeRecord.getCellValue("Name") === lookupValue) {
let linkID = rangeRecord.id;
//"Volunteers" is column name from mainTable which should contain the link
await mainTable.updateRecordAsync(record, {
"Volunteers": [{id: linkID}]
});
}
}
}