I’ve made this very simple little setup where I can select a name, and find the records that matches the selection. I can access the ID of a linked recored via lookups, but is there a way to directly access the ID of the linked records from my ‘Select Name’?
let viewStaff = tableContact.getView(tableContactView);
let choosePerson = await input.recordAsync('Pick a person', viewStaff);
let personID = choosePerson.id; //have to use Id's when using linked records
output.inspect(personID)
//loadReportRecords
let reportQuery = await tableReport.selectRecordsAsync();
output.inspect(reportQuery)
let reportRecordsForPerson = reportQuery.records.filter(record => {
// Arrays in JavaScript have a method called some, which returns
// true if at least one element in the array matches a condition
return record.getCellValue(reportField).some(nameRecord =>
nameRecord.id === personID
);
});
output.inspect(reportRecordsForPerson)
reportRecordsForPerson.forEach(record => output.inspect(`${record.getCellValue("lookupName")}, ${record.getCellValue("recordID")}`))
reportRecordsForPerson.forEach(record => {
output.inspect(record.getCellValue("Select Name").forEach(record => record.id))
})


