Power automate split string into an array with examples

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.

power automate split string into array newline
power automate split string into array newline

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’.

power automate split string into array newline
power automate split string into array newline

Now click on the next step, and select the Compose action. Then in the Input box write the below expression:

split(variables('MyString'),'with')
power automate split string into array newline
power automate split string into array newline

Now click on save and run the flow manually. We can see the result in the compose output.

power automate split string into array newline
power automate split string into array newline

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.

power automate split string into array line break
power automate split string into an array line break

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.

power automate split string into array line break
power automate split string into an array line break

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)
power automate split string into array line break
power automate split string into array line break

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'))
power automate split string into array line break
power automate split string into array line break

Now click on save and run the Flow, you can see the result in the compose 2 output.

power automate split string into array line break
power automate split string into array line break

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.

power automate split string  into array and loop
power automate split string into array and loop

Select the compose action and in the input write the below string.

power automate split string  into array and loop
power automate split string into array and loop

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'),'|')
power automate split string  into array and loop
power automate split string into array and loop

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'),';')
power automate split string  into array and loop
power automate split string into array and loop

Now click on Save and run the flow manually, we can get the result in the compose output.

power automate split string  into array and loop
power automate split string into array and loop

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.

 split string by comma in  Microsoft Flow
split string by comma in Microsoft Flow

Select the initialize variable action and set the variable name, type as string, and value like below.

 split string by comma in  Microsoft Flow

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'),',')
power automate split string by comma
power automate split string by comma

Now save and run the flow manually, after that we can see the result in the compose output.

power automate split string by comma
power automate split string by comma

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.

 split string by space in the Microsoft flow
split string by space in the Microsoft flow

Select initialize variable action and then set the variable name, type as string, and value.

power automate split string by space
power automate split string by space

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'),' ')
power automate split string by space
power automate split string by space

Now click on Save and run the Flow manually. We can see the result in the Compose output.

power automate split string by space
power automate split string by space

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.

 split string into array by character using Microsoft FLow
split string into array by character using Microsoft Flow

Select the initialize variable action, and then set the variable name, type as string, and value.

 split string into array by character using power automate
split string into array by character using power automate

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')
power automate split string into array by character
power automate split string into array by character

Now click on Save and run the Flow manually, we can see the result in the compose output.

power automate split string into array by character
power automate split string into array by character

Related Power Automate tutorials:

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
  • >