Usage Of Or Function In Power Automate

​Introduction

In Power Automate, for doing validations the Or Function will be used. As an example, an String variable and a number is used to do this validation.

Step 1

Login to the required Power Apps environment using URL make.powerapps.com by providing username and password and click on Flows on the left-hand side as shown in the below figure.

Usage of or Function in Power Automate

Step 2

After Step 1, Click on New Flow and select instant cloud flow and provide the trigger as Manually trigger a flow and click on Create as shown in the below figure.

Usage of or Function in Power Automate

Step 3

After Step 2, name flow as or  Function and take a parallel branch and provide names of 2 initialize variables as Set String Variable for a Person with the following fields

Name : Person
Type : String
Value : Venkat

And other variable step name as Set Number to 1 with the following values.

Name : Number
Type : Integer
Value : 1

as shown in the below figure.

Usage of or Function in Power Automate

Step 4

After Step 3, take a compose action and name it as Check if String Variable contains Venkat OR Number Variable equal to 3 (T,F)  with or function which expects

or(expression1: boolean, expression2: boolean)
and provide values as
or(contains(variables('Person'),'Venkat'),equals(variables('Number'),3))

as shown in the below figure.

Usage of or Function in Power Automate

Step 5

After Step 4, take a compose action and name it as Check if String Variable contains Venkats OR Number Variable equal to 4 (F,F)  with or function

as

or(contains(variables('Person'),'Venkats'),equals(variables('Number'),6))

as shown in the below figure.

Usage of or Function in Power Automate

Step 6

After Step 5, take a compose action and name it as Check if String Variable contains Venkat OR Number Variable equal to 1 (T,T) with or function

as

or(contains(variables('Person'),Venkat),equals(variables('Number'),1))

as shown in the below figure.

Usage of or Function in Power Automate

Step 7

After Step 6, test and run the flow and you can observe or function provide result as true, false and true as shown in the below figure.

Usage of or Function in Power Automate

Note
Make sure to save and run the flow whenever you try expressions.

MS documentation is found at here.

Conclusion

In this way we can use the or function so that basic validation on strings and numbers can be done in power automate can be done easily.


Similar Articles