Logic Apps: Comparing two variables

James Arndt 1 Reputation point

How do you compare two variables in a Logic App? I've tried using the "Condition"

Is it possible to use the "Condition" logic app to compare two dynamic variables? I've got these two variables that are both strings. I know they're equal to each other, but it keeps returning false. If variables cannot be compared this way, then how?


Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,819 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sreeju Nair 11,601 Reputation points

    Try using the equals method.

    Refer: Azure routes network traffic between all subnets in a virtual network, by default.

    e.g. equals('abc', 'abcd')

    0 comments No comments

  2. MayankBargali-MSFT 67,986 Reputation points

    @James Arndt Your condition looks good to compare the two string variables. The only scenario that I could think about is when the condition is getting false when you are assigning the value of any of these variables inside the loop. When you assign the value inside the value of the variable will be overwritten as the loop by default runs in parallel. If this is the case you need to run the loop sequentially or any other action that is running in parallel and assign the variable value inside it.

    0 comments No comments