Hi All - new here and a bit of a novice developer but trying to automate a simple creation of new records in one table when a new record is created in another table. I’ve been trying to mimic a bit of the parent /template script example but my filter function wont read my input variable that is part of the automation.
let listTable = base.getTable('List of Metrics');
let importQuery = await listTable.selectRecordsAsync();
let importRecords = importQuery.records;
let metricsTable = base.getTable('Metrics');
let inputConfig = input.config();
let companySector = inputConfig.companySector;
let imports = importRecords.map(c => ({
'Sector': c.getCellValue('Sector'),
'Stage': c.getCellValue('Stage'),
'Name': c.getCellValue('Name'),
})).filter(x => x.Sector.includes(companySector))
I’m trying to filter the imports by sector, but an error I’m getting is that since companySector is a string it is not compatible and reads as null.
Feel like I’m missing something simple, thanks!