Hi!I'm trying to filter out record where field 'value' is null, but it only gives the record of the first item, here's the code
local!validValues:ri!properties[where(a!isNotNullOrEmpty(ri!properties['recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property.fields.{041a7f43-dfd1-4b07-aaed-48e305712f4e}value']))],
Any inputs?
Thank you
Discussion posts and replies are publicly visible
Rather than indexing, can you try applying the query filters using "not null" operator? This should ideally retrieve records that do not have null values.
the problem is that this is added data not in the record that i want to save after editing it
Here's an example with a map but the same logic applies.
a!localVariables( local!values: { a!map(id: 1, value: "1"), a!map(id: 2, value: "2"), a!map(id: 3, value: null) }, reject( a!isNullOrEmpty, a!forEach( items: local!values, expression: if( a!isNotNullOrEmpty(fv!item.value), fv!item, null ) ) ) )
Another option that avoids that clunky (IMHO) way of trying to use foreach to filter a list.
a!localVariables( local!values: { a!map(id: 1, value: "1"), a!map(id: 2, value: "2"), a!map(id: 3, value: null) }, index( local!values, where( a!forEach( items: local!values.value, expression: a!isNotNullOrEmpty(fv!item) ) ) ) )