Power Automate split expression: how to use it

How-to basics · Updated November 23, 2026

The split expression in Power Automate is split('text', 'delimiter'), which breaks a string into an array of substrings wherever the delimiter appears. For example, split('apple,banana,cherry', ',') returns ['apple', 'banana', 'cherry']. You use it in the expression editor (the fx box) of any action that accepts dynamic content, and the result is an array you can loop over with Apply to each or index directly.

What the split expression actually does

Power Automate’s split() function is modeled on the same function in Excel and many programming languages. It takes two arguments:

  • Text – the string you want to break apart. This can be a literal string in quotes, a dynamic value from a trigger or action, or a combination of both.
  • Delimiter – the character or sequence of characters that marks where the split happens. It can be a comma, a space, a semicolon, a newline, or even a multi-character string like "::".

The output is always an array. If the delimiter is not found at all, the array contains the entire original string as its only element. If the text is empty, the array is empty.

How to write the split expression in the editor

When you click into any input field that accepts dynamic content, you’ll see the Expression tab (the fx icon). Type or paste the expression there. For a literal test:

  1. In the expression tab, type split('red,green,blue', ',').
  2. Click OK or Update.
  3. Use the output in a Compose action to see the array, or pass it to Apply to each.

To use a dynamic value, replace the first argument with the dynamic content token. For example, if a trigger gives you a Subject field, you might write split(triggerOutputs()?['headers']?['Subject'], ' ') to split the subject line into words. In the expression editor, you can select the dynamic token from the left panel, then type around it.

Common use cases for split in flows

Most flows use split() to handle data that arrives as a delimited string. Typical scenarios include:

  • Email addresses from a list – split on ; or , to send to each recipient separately.
  • CSV rows from a file or API – split each line on commas to get fields.
  • Tags or categories – split a string like "urgent;finance" into an array to check membership.
  • File paths – split on / or \ to get folder names.
  • User input from a form – split on newlines to process each line as a separate item.

After splitting, you typically add an Apply to each action that iterates over the array. Inside the loop, reference items('Apply_to_each') to get the current element.

How to split by newline or multiple characters

Splitting by a newline is a frequent need because text areas in forms often return line breaks. In Power Automate, a newline is represented by \n (LF) or \r\n (CRLF). To split on both, you can use:

split(variables('multiLineText'), '\n') – but this leaves a trailing \r on Windows-style lines. A more robust approach is to replace CRLF first:

split(replace(variables('multiLineText'), '\r\n', '\n'), '\n')

For a multi-character delimiter, just put the whole sequence in quotes: split('a--b--c', '--') returns ['a', 'b', 'c']. There is no need to escape the delimiter unless it contains a backslash or quote.

Indexing into the result and handling empty items

Once you have the array, you can access a specific element using the [] notation. For example, split('2024-05-01', '-')[0] returns '2024'. The index is zero-based, so the first item is [0]. This is useful when you only need the first or last part of a string.

Be aware that consecutive delimiters produce empty strings. split('a,,b', ',') returns ['a', '', 'b']. If you need to remove empty entries, you can filter the array with a Filter array action or use the skip() function, but there is no built-in split option to ignore empties. A common workaround is to replace double delimiters with a single one before splitting, but that changes data if the empty values matter.

Common errors and troubleshooting

Three mistakes trip up most users:

  • Missing quotes – The text and delimiter must be quoted if they are literals. split(abc, ',') fails because abc is treated as a variable name, not a string.
  • Wrong delimiter type – The delimiter must be a string, not a number or boolean. split('123', 2) errors.
  • Using split on a non-string – If the input is a number or object, Power Automate may auto-convert it, but it’s safer to wrap it in string() first: split(string(variables('num')), ',').

Another error is forgetting that the output is an array, not a string. If you try to use the result directly in a text field, you’ll see something like ["a","b"]. To join it back into a string, use the join() function: join(split('a,b', ','), ' | ') returns 'a | b'.

Split vs. other string functions

split() is not the only string tool in Power Automate. Knowing when to use which saves time:

  • substring() – extracts a fixed-length portion starting at an index. Use when you know the exact position, not a delimiter.
  • replace() – swaps one substring for another. Use to normalize delimiters before splitting.
  • trim() – removes leading and trailing spaces. Often used on each split item to clean up.
  • indexOf() – finds the position of a delimiter. Use if you need to split only at the first occurrence manually.

For example, to split on the first comma only, you could combine indexOf() and substring(), but it’s simpler to split and then take the first two elements with take().

Frequently Asked Questions

Can I split a string by a space? Yes, use ' ' as the delimiter. For multiple spaces, use ' ' (two spaces) or replace double spaces first.

Does split work on arrays? No, split() only works on strings. To break an array into chunks, you need a different approach, like a loop or the chunk() function (available in some connectors) or a custom expression with range() and skip().

How do I split a string from a SharePoint column? Use the dynamic content token for the column inside the expression. For example, split(item()?['Title'], '-') inside an Apply to each loop.

Why does my split return an array with one element? That means the delimiter was not found anywhere in the text. Double-check the delimiter spelling and whether the text contains extra spaces or hidden characters.

Can I use split in a condition? Yes, you can use contains(split(text, ','), 'value') to check if a specific item exists in the resulting array. This is a common pattern for tag filtering.

Is split case-sensitive? Yes, the delimiter must match exactly. If your text has mixed case, consider using toLower() on both the text and delimiter before splitting.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.