Hi,
If I need to get the vehicles Data where ID in {1,2,3}, I can do this :
index( ri!vehicles, wherecontains( {1, 2, 3}, ri!vehicles.id ) )
But is there any way to do the same thing with a negation (a kind of notWhereContains) ? I mean I need to get the vehicles data where ID not in {1, 2, 3}.
Of course, I can then use a foreach to get the correct data, or create an exclusion list items, to apply the whereContains on the latter,
but is there any other way to do it with a single simple instruction ?
Discussion posts and replies are publicly visible
Replacing the index function with fn!remove also helps achieve your use-case.
a!localVariables( local!vehicles: { a!map(id: 1, vehicle: "A"), a!map(id: 2, vehicle: "B"), a!map(id: 3, vehicle: "C"), a!map(id: 4, vehicle: "D"), a!map(id: 5, vehicle: "E") }, remove( local!vehicles, wherecontains({ 1, 3, 5 }, local!vehicles.id) ) )
Thank you Siddharth, interesting... I did not think about such a way...