There are many text functions that can be used in Power Automate to modify string functions. In this article we will be going over what the length function is and how to use it in Power Automate.
What is the Length Function?
The Power Automate length function returns the length of a string or the length of an array.
Syntax
length('<collection>')
length([<collection>])
Step-by-Step guide to using length function
Step 1: Create A New Flow (make.powerautomate.com)

Step 2: Use initialize variable to create a string

Step 3: Add a compose action card to hold the length function expression shown below:
The expression we will use is:
length(variables('myString'))

Step 4: Add an array variable using the ‘initialize variable’ action card with the following details:

Step 5: Add a compose action card to hold the array variable with the following details:
The expression you will use is:
length(variables('myArray'))

Step 6: Save and Test your flow. Your results should resemble the results I got from running the flow.
For the String:

For the Array:

The length function as shown in the above steps is a very simple function that can be used to find the length of both strings and arrays. Though we have gone over very simple examples of its use, it can be used in more complex means such as data validation, conditional logic, and monitoring/alerting scenarios.
Feel free to share your learnings with others and comment if you have any questions.