In this Power Automate tutorial, we will learn how to split a string into an array in Power Automate. Let us see a few examples of Power Automate split string into an array. And also we will discuss the below Points:
- Introduction to Power Automate split string
- Power automate split string into array newline
- Power automate split string into array line break
- Power automate split string into array and loop
- Power automate split string by comma
- power automate split string by space
- Power automate split string into array by character
Power Automate split string
The Power Automate split function breaks down your string into an array of strings using the delimiter that you defined. And think that the delimiter is as a border.
In the string, the left of the delimiter is an entry on the array, and the right is another.
Power automate split string into array newline
Here we will see how to split the string into array newline in Power Automate with an example.
Let’s take a string ‘I will split the string with split function’, here we will split the string from ‘with’. So after splitting it will be two arrays i.e. ‘I will split the string’ and ‘split function’.
For this, we will create a manually triggered flow and then click on the Next step.
Select the ‘Initialize variable’ action and then set the variable name, type as a string, and the value as ‘I will split the string with split function’.
Now click on the next step, and select the Compose action. Then in the Input box write the below expression:
split(variables('MyString'),'with')
Now click on save and run the flow manually. We can see the result in the compose output.
Read Power Automate Rename File
Power automate split string into array line break
Here we will see how to split the string into an array line break using Microsoft Flow or Power Automate.
In the Power automate click on manually trigger flow and then click on the Next step.
Select the Initialize variable action, set the variable name, type as a string, and value like below, and also make sure to enter two spaces after the split.
After that click on the Next step, and select the Compose action. Then in input write the below expression:
take(first(skip(split(variables('MyString'),' '),1)),1)
Now we will use the compose output to split the string with the line break character.
So click on the Next step and then select Compose action to split the string with the line break character. Then in Input write the below expression:
split(variables('MyString'),outputs('Compose'))
Now click on save and run the Flow, you can see the result in the compose 2 output.
Read Power Automate String Functions + 10 Examples
Power automate split string into array and loop
Here we will see how to split the string into an array and loop using Power Automate or Microsoft Flow.
In the Power Automate click on Manually trigger flow, and then click on Next step.
Select the compose action and in the input write the below string.
Now we will split the string and save it to the array variable. So, click on the next step and select Initialize variable action.
Then provide the variable name, type array, and in values write the below expression:
split(outputs('Compose'),'|')
Now we will use apply to each loop to split each item in the array variable. So click on the Next step and then select the Apply to each action.
In the value box, provide the array variable from the dynamic content. Then click on Add an action inside the loop and select Compose action.
In Compose input add the below expression:
split( items('Apply_to_each'),';')
Now click on Save and run the flow manually, we can get the result in the compose output.
Read Power Automate send email from shared mailbox
Power automate split string by comma
Here we will see how to split into strings by comma using Microsoft Flow or Power Automate.
In the Power automate select the manually triggered flow. Then click on the next step.
Select the initialize variable action and set the variable name, type as string, and value like below.
split string by a comma in Microsoft Flow
Now we will split the string by comma in Microsoft flow. And then click on the next step, select Compose action to split the string by comma. Then in Input set the below expression:
split(variables('varString'),',')
Now save and run the flow manually, after that we can see the result in the compose output.
Read Power Automate Parse Email Body
Power automate split string by space
Here we will see how to split string by space using Power Automate.
In the Power Automate, select the Manually triggered flow, and then click on the next step.
Select initialize variable action and then set the variable name, type as string, and value.
Now we will split the string by space. Then click on the Next step, and select the Compose action. In the input box add the below expression:
split(variables('varString'),' ')
Now click on Save and run the Flow manually. We can see the result in the Compose output.
Read Power Automate Date Functions – 9 Examples
Power automate split string into array by character
Here we will see how to split a string into arrays by characters in Microsoft Flow.
In the Power Automate, select the Manually triggered flow. Then click on the Next step.
Select the initialize variable action, and then set the variable name, type as string, and value.
Now we will split the string into arrays by using characters. So click on the Next step and then select Compose action. In input add the below expression:
split(variables('varString'),'o')
Now click on Save and run the Flow manually, we can see the result in the compose output.
Related Power Automate tutorials:
- Power Automate Get Data from Excel on SharePoint
- Power Automate Forms to Excel
- Power Automate create an HTML table
- Power Automate Switch case
- Power Automate send an email with an attachment from SharePoint
- Power Automate update SharePoint list increment integer field
- Power Automate wait timer
In this Power Automate tutorial, we learned power automate split string into an array. And also we will discuss the below points:
- Power automate split string into array
- Power automate split string into array newline
- Power automate split string into array line break
- Power automate split string into array into array and loop
- Power automate split string by comma
- Power automate split string by space
- Power automate split string into array by character
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
What would be a use case for this scenario?
I had one case that i had to get the file name and split it to get some values that were a pattern of the file name, so i used the split to get this values and add to others variables
Hi Tiago – I’m in a similar position whereby I need to split the file name into some values and then put the values under respective columns in SharePoint. May you please kindly point me into the right direction?
Can we have an example to load null values with a split function?
Great tutorial! Need next step: once I have broken a string into separate lines (i.e.: “Alex”, “Emma”, “Ruby”, “Stwart”) how can I transfer each line into, for example, the fields in a “Create Item” action?