length function. Collection.(Power Automate Cloud flows)

03/11/2024

Japanese version.

Function to get the number of items in an array.

length also has a function of the same name to get the number of characters.

Spec

length(<collection>)
ArgumentDefaultDescription
collectionRequired fieldTarget array.

How to use

In many cases, it is used to initialize or set variables of type "Integer".

This function is often used in "Condition".

Clicking on length in the "Expression" tab sets the function name and () in the formula field.

Argument is one array.

When dynamic content or variables are used in expressions, special specifications are required.

(How to get dynamic content with expressions.)

If you see something like the following, the setup is complete.

You can change the contents of the function by clicking on the purple icon.

In this case, array variables [100,300,400] are provided as an example.

If the expression is "length(variables('ary1'))", the result is 3.

For those who want to learn Power Automate Cloud flow effectively

The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Cloud flow to streamline your workflow.

Links

Collection Functions(Power Automate Cloud flows)

Examples of Use

How to get the count, sum, average, maximum, and minimum of numbers in an array.