Filter a query using an object array

1204 1
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hi, I’m struggling with this script (I’m a newbie) you see below. I have the array “dependencyOrderSplit” which, can have more than 1 string object. I should use these strings to filter thru “let filteredRecords = queryResult.records.filter” and comparing the string field “order” with ALL the objects [0, 1, 2, etc.] and retrieve the which comply with that. My problem is I don’t know how to obtain a new array with ALL the filtered records. If I use [0] as in the example, only object 0 is retrieved, but object 1 not. Any ideas?
Captura de pantalla 2021-12-20 a las 9.47.01

1 Reply 1

you should check it vice versa, if array includes element,

return dependencyOderSplit.includes(dependent.getCellValueAsString(‘Order’))