I'm using a Logic App that contains a FOR EACH called "For_each_Item_in_Items". The FOR EACH is running on an array from an SQL query. I'm interested in a column called "Exists" which contains a string of either "ABC" or "DEF".
To get this value I'm using a "Set variable" action as follows:
@{items('For_each_Item_in_Items')?['Exists']}
This works.
Now I need to take this expression in the "Set variable" action and use it in an IF statement. However I need help with the syntax.
I've tried the following with no success:
@{if(equals(items('For_each_Item_in_Items')?['Exists'], 'ABC'), '1', '2')}
@{if(equals({items('For_each_Item_in_Items')?['Exists']}, 'ABC'), '1', '2')}
@{if(equals(string(items('For_each_Item_in_Items')?['Exists']), 'ABC'), '1', '2')}
Any help or advice would be appreciated.