Following up on: Help on Script with Math Function
I have a new question. How can I find the record id of a record in a table. Here is my code so far:
let table = base.getTable(‘Project List’);
let queryResult = await table.selectRecordsAsync();
let record = queryResult.getRecord(queryResult.recordIds[0]);
console.log(record)
let yearstring = record.getCellValue(‘Year String’)
console.log(yearstring)
let yeartable = base.getTable(“Year”)
let yeartablequery = await table.selectRecordsAsync();
[here I want to add a filter/find function to get record - call it linkedrecord]
await table.updateRecordAsync(record.id, {“Year”: linkedrecord})
let year = record.getCellValue(‘Year Count’);
console.log(year);
let num = parseInt(year)+20018;
await table.updateRecordAsync(record.id, {“Project #”: num})
What I want to do is filter/find the record in yeartable by the name yearstring in field ‘Name’. In other words, I have a list of records in yeartable and the Name field is the Year. I want to search the table for the record with a name that matches yearstring, because I want to link that record in the other table.