Hello,
I have two tables (“Table 1” and “Table 2”) that are linked on a single field (“My Field 2”) with a many-to-many relationship.
I’m trying to write a script to gets all of the records from the table Table 1
where the field My Field 2
does not contain a particular linked record from table Table 2
. I know how to write this script normally, but because field My Field 2
on both tables Table 1
and Table 2
allow linking to multiple records I know that I need to use an array in the filter in my script and can’t seem to get that part correct.
Code is below. If someone could help me get the array correct in the filter, I would really appreciate it!
let tableMyTable1 = base.getTable("MyTable1")
let queryMyTable1 = await tableMyTable1.selectRecordsAsync();
let recordsMyTable1 = queryMyTable1.records.filter(records => { !(records.getCellValue("MyField2").includes(recordMyTable2)) })
Thank you so much!