An Azure service that automates the access and use of data across clouds without writing code.
This works:
@if(equals(string(items('For_each_Item_in_Items')?['Exists']), 'ABC'), '1', '2')
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
An Azure service that automates the access and use of data across clouds without writing code.
This works:
@if(equals(string(items('For_each_Item_in_Items')?['Exists']), 'ABC'), '1', '2')
anonymous user Thanks for posting the resolution. Posting for other community members, you can always refer to the workflow definition function reference document. The usage and example for logical comparison function if are covered here.