Power Automate Fundamentals # 55: Usage of Empty Function in Power Automate

Introduction:

In Power Platform, at times we must verify whether the given json object or string or array have empty value or not. In Power Automate, Empty Function can be used quickly to find out whether empty value present or not.

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 the flow as Empty Function and take a parallel branch and one side of branch take an initialize variable and name it as Initialize variable – Array Names and provide values

Name: Names

Type: Array

Value: [“Venkata”,”Polisetty”,”Subbarao”]

as shown in the below figure.

Step 4:

After Step 3, to the other side of  parallel branch take another initialize variable and name it as Initialize variable – String Name and provide values

Name: Name

Type: String

Value: “Venkata”

as shown in the below figure.

Step 5:

After Step 4, another end of parallel branch take an action and name it as Initialize variable  – Json Names and provide values as

Name: Names Json

Type: Object

Value:

{

“Names”:

 {

        “Names1″:”Venkata”,

        “Names2″:”Subbarao”,

        “Names3″:”Polisetty”

}

}

as shown in the below figure.

Step 6:

After Step 5, under Initialize variable – Array Names take compose action and provide empty function which Returns true if an object, array, or string is empty and use empty function as

empty(collection: object|array|string)

and provide values as

empty(variables(‘Names’))

in the below figure.

Step 7:

After Step 6, under Initialize variable – String Name,take compose action and provide inputs as

empty(variables(‘Name’))

in the below figure.

Step 8:

After Step 7,under Initialize variable  – Json Names take compose action and provide inputs as

empty(variables(‘Names Json’))

in the below figure.

Step 9:

After Step 8,save and test the flow and observe the results as shown in the below figure.

Note:

  1. Make sure to save and run the flow whenever you try expressions.
  2. Make sure to provide input array in proper acceptable format of string array.
  3. Also use double quotes for the elements in the array.
  4. For object, make sure to frame it as json object.

Conclusion: In this way we can use empty function in power automate to achieve customer functionality.

One thought on “Power Automate Fundamentals # 55: Usage of Empty Function in Power Automate

  1. Pingback: Rewind February 2022 – Common Man Tips for Power Platform, Dynamics CRM,Azure

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 )

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