0

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.

1 Answer 1

1

After reproducing from our end we found it was working fine by removing "{ }". i.e..

@if(equals(items('For_each_Item_in_Items')?['Exists'], 'ABC'), '1', '2')

REFERENCES: Reference guide for functions in expressions - Azure Logic Apps

Sign up to request clarification or add additional context in comments.

1 Comment

Yes I found the same! Thanks for investigating! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.