Skip to main content

Filter a query using an object array

  • December 20, 2021
  • 1 reply
  • 11 views

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 record.id 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?

1 reply

Alexey_Gusev
Forum|alt.badge.img+25
  • Brainy
  • December 20, 2021

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

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