Power Automate Functions - LENGTH Function

Power Automate Functions - LENGTH Function


LENGTH Function

What is the LENGTH function?

LENGTH function returns us about the length of that array. It tells us how many values or objects are there in the array.

Return us Length of character in ‘STRING’ type

Return us the length of the object in the ‘ARRAY’ type

Description:

In this guide, we will discuss how to use the float function in power automation. Let us create a new flow. To create a new flow follow the following instructions:

Go to power Apps:

Power Automate Functions - LENGTH Function

Navigate to Flows:
Power Automate Functions - LENGTH Function

Click on the ‘New Flow’ button:
Power Automate Functions - LENGTH Function

After clicking new flow, select ‘Instant Cloud flow’ from the dropdown:
Power Automate Functions - LENGTH Function


In the below screenshot we set the Name of flow and its trigger point which is ‘Manually trigger a flow. Finally, click on the create button to create a new flow. 
Power Automate Functions - LENGTH Function

First, add INITIALIZE VARIABLE ACTION:
To initialize a variable select initialize variable action from the actions set. Then set its properties the same as mentioned in the screenshot.
1# INITIALIZE VARIABLE ACTION
INITIALIZE VARIABLE:
Initialize a variable having the following attributes. 
Name: set variable name
Type: set the type of variable as ‘array’
Value: set values as
There is an array named Dogs Names you can calculate the length of this array using the ‘length’ function in the compose action. This length function tells you how many dogs are there in this array.
Power Automate Functions - LENGTH Function


ADD COMPOSE ACTION
Add compose action to call ‘length function’ 
Power Automate Functions - LENGTH Function

CODE:
length(variables('DOGS NAMES'))

OUTPUT:
Here is the output of the length function. This function returns us five means there are five names of dogs in the array.
Power Automate Functions - LENGTH Function
CODE:
length(variables('DOGS NAMES'))

OUTPUT:
Here is the output of the length function. This function returns us five means there are five names of dogs in the array.
Power Automate Functions - LENGTH Function



2# INITIALIZE VARIABLE ACTION
INITIALIZE VARIABLE:
Initialize a variable having the following attributes. 
Name: set variable name
Type: set the type of variable as ‘STRING’
Value: “WALTER”
In this variable ‘length function’ will return the length of characters. In out input or value of a variable. There is 8 letter with “” 6+2=8. It will return us 8 in output.
Power Automate Functions - LENGTH Function

ADD A COMPOSE ACTION
Add compose action and call length function in it.
Power Automate Functions - LENGTH Function

EXPRESSION:
length(variables('STRING VARIABLE'))

OUTPUT:
Power Automate Functions - LENGTH Function






0 Comments

Thanks for commenting. Your comment will be live soon after approval.