In Power Automate, there are many situations where you need to split a string and retrieve a specific part, such as the first, last, or any specific n-th value. For example, suppose you have a string like this: “123 Main Street, Springfield, IL, 62704.”
Now, you want to extract only the city (Springfield) or the ZIP code (62704), or even just the street name (123 Main Street).
That’s where the split() function becomes useful. You can break the string into parts using a delimiter (like a comma), and then pick the exact item you need.
In this Power Automate tutorial, I will show you:
- Get the First Item from a Split String in Power Automate
- Split a String and Retrieve the Last Value in Power Automate
- Retrieve the N-th Item from a String in Power Automate
Get First Item From a String in Power Automate
Let’s say you’re collecting responses from a Microsoft Form where users enter a list of their skills, separated by commas. For example:
Excel, Power BI, SharePoint, Teams
You want to extract only the first skill from the list (in Excel) and store or display it in another step of your workflow.
Follow the below steps:
- Create an Instant cloud flow (with a manual trigger).
- Add a “Initialize variable” action:
- Name: UserSkills
- Type: String
- Value: Excel, Power BI, SharePoint, Teams

- Add a “Compose” action. In the Inputs field, enter the following expression:
split(variables('UserSkills'), ',')[0]

After that, click Save and then Run it manually. Once it runs successfully, click the compose action.

This expression splits the string by commas and returns the first item (index 0) from the array in Power Automate.
Check Out: Create Multi Agent in Copilot Studio
Get First Item From a String Using first() in Power Automate
Suppose you’re processing job application data submitted through a SharePoint list. One of the columns, Preferred Locations, stores multiple city names as a comma-separated string, like:
New York, Chicago, San Francisco, Seattle
You want to get the first preferred location, which is New York, and use it in an email or condition.
Check the steps below:
- Create or open a flow that’s connected to your SharePoint list.
- Add Initialize variable action and provide the below parameters:
- Name: Skills
- Type: String
- Value: New York, Chicago, San Francisco, Seattle

- Add a Compose action to get the first item. Use the following expression:
first(split(variables('Skills'), ','))

Output: