Power Automate Functions - FIRST & LAST Function

Power Automate Functions - FIRST & LAST Function

What is the first and last function?

We use it to get the first and last value in the array and string.

It same as the previous (skip function). In this function, we will earn how to get the first and last names from an array. And how to get the first and last letter from a string.

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 - FIRST & LAST Function
Navigate to Flows:
Power Automate Functions - FIRST & LAST Function

Click on the ‘New Flow’ button:
Power Automate Functions - FIRST & LAST Function

After clicking new flow, select ‘Instant Cloud flow’ form the dropdown:
Power Automate Functions - FIRST & LAST Function

Finally set its name and select ‘manually’ as flow trigger point:
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 - FIRST & LAST 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.
Initialize a variable having a type array and set some name as its value.
Power Automate Functions - FIRST & LAST Function


1# COMPOSE ACTION
FIRST ARRAY FUNCTION:
Fist array function will get the first name from the given array values.
Power Automate Functions - FIRST & LAST Function

CODE:
first(variables('ARRAY NAME'))

OUTPUT:
The first name in the given array list or values is ‘SHEHRYAR SULTAN’  it will return us this name
Power Automate Functions - FIRST & LAST Function


2# COMPOSE ACTION
LAST ARRAY FUNCTION:
The last array function is used to get the last value given array values
CODE:
last(variables('ARRAY NAME'))

INPUT:
Power Automate Functions - FIRST & LAST Function


OUTPUT:
The output of this function will be. The last name in the given array values is MOEEN  so it returns us MOEEN

Power Automate Functions - FIRST & LAST Function

3# COMPOSE ACTION
FIRST STRING FUNCTION:
The first string function is used to get the first letter from the given ‘name’ like the name is SHEHRYARSULTAN  it will extract the first letter ‘s’
CODE:
first(variables('STRING NAME'))

INPUT:
Power Automate Functions - FIRST & LAST Function

OUTPUT:
Power Automate Functions - FIRST & LAST Function
4# COMPOSE ACTION
LAST STRING FUNCTION:
LAST string function is used to get the LAST letter from given ‘name’ like the name is SHEHRYARSULTAN it will extract first letter ‘N’
CODE:
last(variables('STRING NAME'))

INPUT:
Power Automate Functions - FIRST & LAST Function


OUTPUT:
Power Automate Functions - FIRST & LAST Function


0 Comments

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