Hello,
I have a similar question to: https://community.appian.com/discussions/f/rules/21530/getting-one-property-value-from-dictionary-based-upon-another-property-value.
But instead of returning true/false, I need it to match it against a string value on match condition:
a!localVariables( local!myDictionary: { { item: 1, active: "A", description: "Widget", color: "Green"}, { item: 2, active:"B", description: "another", color: "red"} }, local!tempResults: if(fn!index(local!myDictionary,"active","") = "A" ,"yes","no"), reject(fn!isnull, local!tempResults) )
The index returns the "A", but when I do a condition against it (if statement), nothing returns. I want the string "Green" returned if it matches "A". IT says it doesn't match it.
Discussion posts and replies are publicly visible
Hi, the fn!index() returns an array. so we can use contains() operator instead of =
do you mean :
local!tempResults: if(contains(fn!index(local!myDictionary,"active",""),"A") ,"yes","no"),