web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Power Automate Fundamentals # 56: Usage of Length Function in Power Automate

venkatsr Profile Picture venkatsr User Group Leader

Introduction:

In Power Platform, at times we must length of a string or elements in an array to perform certain operations on them. In Power Automate, Length Function can be used quickly to find out whether the given string or Array have values 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 Length Function and take a parallel branch and one side of branch take an initialize variable and name it as Initialize variable – Names Array 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 and provide values

Name: Name

Type: String

Value: “Venkata”

as shown in the below figure.

Step 5:

After Step 4, under Initialize variable – Names Array take compose action and provide length function which Returns Returns the number of elements in an array or string and use length function as

length(collection: array|string)

and provide values as

length(variables(‘Names’))

in the below figure.

Step 6:

After Step 5, under Initialize variable ,take compose action and provide inputs as

length(variables(‘Name’))

in the below figure.

Step 7:

After Step 6,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.

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


This was originally posted here.

Comments

*This post is locked for comments