Power Automate Fundamentals # 32: Usage of or Function in Power Automate

Introduction:

In Power Automate, for doing validations 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.

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.

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.

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.

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.

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.

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.

Note:

  1. Make sure to save and run the flow whenever you try expressions.
  2. MS documentation is found at here

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s