Im trying to expand the report example, to make my own custom report.
However I’m completely stuck on filtering an array of records that contains a specific name.
I’ve tried a few different things (commented out below), but I don’t seem to get it to work.
I have a table called ‘report’ in that base there is a field called ‘names’ and I want to filter all away all the records that does not contain the value ‘Dan’ in my names field.
I hope someone has time to help an aspiring JS developer.
let tableReport = base.getTable('report')
let filter = 'Dan'
//loadReportRecords
let reportRecords = await tableReport.selectRecordsAsync();
//let filteredRecords = reportRecords.getRecord(reportRecords.recordIds).getCellValue("names")
//let filteredRecords = reportRecords.records.filter(record => record.getCellValue("names")===filter);
/*
let filteredRecords = reportRecords.records.filter(function(reportRecord){
return reportRecord.getCellValue('names') === 'Dan';
});
*/

