Hello the community,
I would like to add a return value condition in the vlookup script depending on another column containing a specific text.
your support is really appreciate.
Thank you
Here my current script that I would like to improve:
let mainTable = base.getTable(“Inscriptions”);
let mainTableRecords = await mainTable.selectRecordsAsync();
let lookupTable = base.getTable(“Ateliers”);
let lookupRangeRecords = await lookupTable.selectRecordsAsync();
for (let record of mainTableRecords.records) {
let lookupValue = record.getCellValue(“Promo”);
for (let rangeRecord of lookupRangeRecords.records) {
if (rangeRecord.getCellValue("Promo") === lookupValue) {
if (“new column”) is containing this specific text "A1"
let returnValue = rangeRecord.getCellValue(“Date”);
await mainTable.updateRecordAsync(record, {
"Atelier 3": returnValue
});
}
}
}