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:
Click on the ‘New Flow’ button:
After clicking new flow, select ‘Instant Cloud flow’ from the dropdown:
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.
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.
ADD COMPOSE ACTION
Add compose action to call ‘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.
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.
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.
ADD A COMPOSE ACTION
Add compose action and call length function in it.
EXPRESSION:
length(variables('STRING VARIABLE'))
OUTPUT:
0 Comments
Thanks for commenting. Your comment will be live soon after approval.