In Power Automate cloud flows, split() divides a text string wherever a specified delimiter appears and returns the resulting pieces as an array. Use it in an expression such as split('red|green|blue', '|'), then access an item or loop through the array to use the pieces in later actions.
What the split function does
split() is a workflow expression function, not a separate action in a cloud flow. It takes two text values: the string to divide and the delimiter that marks each boundary. The function returns an array, which is an ordered collection of values. For example, splitting red|green|blue at the pipe character produces three elements: red, green, and blue.
This is useful when an earlier step provides several values in one string but a later step needs to handle them separately. A form response might contain several email addresses separated by semicolons; a subject line might combine a ticket number and status with a hyphen; or a text field might hold one value per line. Splitting makes the individual parts available to the rest of the flow.
The delimiter is a literal string, not a pattern or regular expression. If the delimiter is a comma, Power Automate looks for commas; it does not infer other separators or automatically understand the meaning of the text.
Syntax and where to enter the expression
The general syntax is split(text, delimiter). The first argument is the text value to divide, and the second is the exact delimiter to find. Both arguments can be literal text, dynamic content, or the result of another expression.
split('north,south,east', ',')divides a literal string at each comma.split(triggerBody()?['Tags'], ';')divides the value in a trigger property namedTagsat semicolons.split(outputs('Compose'), '|')divides the output of an action namedComposeat pipe characters.
In a cloud flow, select the field where you want the expression, open the expression editor (often labeled Expression or shown through an fx control), and enter the function. The precise editor layout can vary with the designer. When entered in the expression editor, you generally type split(...) without a leading at sign. In a workflow definition or some inline expression contexts, expressions may appear with an @ prefix; that is a representation detail, not part of the function name.
A practical example: separate fields in one string
Suppose a form submits the text CASE-4821|Maya Chen|Open, with the case number, owner, and status separated by pipe characters. A Compose action can hold that text, or the expression can refer directly to the form response. If the action is named Compose, this expression produces the array:
split(outputs('Compose'), '|')
The first item is the case number, the second is the owner, and the third is the status. To put those values into separate fields in a later action, use expressions such as split(outputs('Compose'), '|')[0], split(outputs('Compose'), '|')[1], and split(outputs('Compose'), '|')[2]. Array positions start at zero, so position [0] means the first item, not the second.
If you expect the first or last item rather than a particular position, functions such as first() and last() can make the intent clearer. For example, first(split(outputs('Compose'), '|')) returns the first segment. These expressions assume that the input actually contains the expected number of pieces. A string with a missing delimiter will not magically supply the missing fields, so validate the data before relying on a particular position.
Choosing a delimiter and handling real-world text
Choose a delimiter that is unlikely to occur inside the values themselves. A comma is convenient, but it can appear in a person’s name, address, or description. A distinctive separator such as a pipe or a multi-character marker can reduce accidental splits, provided the source system uses the same separator consistently. The delimiter must match the text exactly: splitting on - (with spaces) is different from splitting on -.
For a semicolon-separated list, the basic expression might be split(triggerBody()?['Recipients'], ';'). If a value is alex@example.com; sam@example.com, the resulting elements may include leading spaces. In an Apply to each loop, use trim(item()) when passing each current element to another action. Trimming removes surrounding whitespace; it does not remove internal spaces or change the delimiter logic.
Adjacent delimiters can produce empty elements. For instance, a value like alpha;;gamma has an empty segment between the two semicolons. Decide whether that represents missing data or should be ignored, and account for it in the flow. Likewise, if the delimiter does not appear, the input remains a single segment; the result is not an error simply because there was no match.
Using the returned array in a flow
After splitting, choose how the flow should consume the array. If each part needs its own operation, add an Apply to each control and provide the split expression as its input. Inside the loop, item() refers to the current element. For example, a flow can split a list of email addresses at semicolons, loop over the results, and send or process each address individually.
If the flow only needs one or two known positions, use array indexing or a function such as first() instead of a loop. To check how many segments were produced, use length(split(outputs('Compose'), '|')). That count can support a condition before the flow reads a particular index. For example, a three-field record should have a count of three before the flow tries to read positions zero, one, and two.
Keep the expression readable by putting the original text in a Compose action when it is long or reused several times. Then downstream expressions can refer to outputs('Compose'). This also makes it easier to inspect the input and output in the flow’s run history when troubleshooting.
Blank values, missing input, and line breaks
A missing or null input deserves attention. A flow can fail if an expression receives a value of an unexpected type, and a blank string may produce an array containing a blank value rather than meaningful data. If the source field is optional, check it before splitting or provide a fallback. For example, split(coalesce(triggerBody()?['Notes'], ''), ',') uses an empty string when Notes is null. That prevents a null argument, but it does not make an empty input useful; add a condition if the flow should skip blank notes.
Line-based text needs care because line endings vary. A line feed is represented by decodeUriComponent('%0A'), while a carriage return is decodeUriComponent('%0D'). If the source uses Windows-style carriage-return/line-feed pairs, normalize them before splitting or check whether the resulting items contain a trailing carriage return. For example, a Compose action can normalize CRLF to LF with replace(outputs('Compose'), decodeUriComponent('%0D%0A'), decodeUriComponent('%0A')); then split the normalized output at decodeUriComponent('%0A').
Do not treat a simple split as a full CSV parser. In quoted CSV data, a comma can be part of a field, and quotation marks and escaped quotes affect how records are read. Splitting a CSV row at every comma can therefore corrupt values such as "Chen, Maya". Use a connector or a parsing approach designed for the actual CSV format when quoted fields or embedded line breaks are possible.
Common problems and how to diagnose them
- The function is entered as a text value. Make sure you use the expression editor, rather than typing the expression into a plain-text field where it will be treated literally.
- The delimiter does not match. Check spaces, punctuation, capitalization, and whether the source uses a different separator than expected. A delimiter is an exact string, not a wildcard.
- An array index is out of range. Confirm the number of segments before requesting an index. Remember that indexing begins at zero.
- Values have unexpected spaces or blank entries. Inspect the run history, then use
trim()for surrounding whitespace and handle empty segments according to the business rules. - A field is null or not text. Check the trigger or action output and convert or guard the value as appropriate before splitting.
Run the flow with representative inputs, including a normal value, a missing delimiter, a blank field, and a value containing extra separators. The run history shows the action inputs and outputs, which helps distinguish a bad source value from an incorrect expression. Avoid testing only the ideal case if the flow will process user-entered text.
Cloud flows versus Power Automate Desktop
The expression split() discussed here is commonly used in Power Automate cloud flows, where actions exchange values and expressions are entered in the cloud-flow designer. Power Automate Desktop is a separate desktop automation environment. It provides a Split text action that divides text and stores the result in a list variable; its configuration and variables are not written using the same cloud-flow expression syntax.
That distinction matters when following instructions or copying an example: a cloud expression such as split(outputs('Compose'), '|') is not a complete Desktop action. In Desktop, configure the Split text action and then use the resulting list with the desktop flow’s list actions. In either environment, the underlying idea is similar—turn one text value into multiple pieces—but the interface and subsequent steps differ.
Frequently Asked Questions
Does Power Automate have a Split action?
Cloud flows use the split() expression function rather than a standalone Split action. Power Automate Desktop has a Split text action with its own settings and list output.
What does split() return in Power Automate?
It returns an array of text segments in the order they appeared in the original string. Use array indexing, functions such as first(), or an Apply to each control to work with those segments.
Can split() use more than one character as a delimiter?
Yes. The delimiter is a string, so it can be a multi-character sequence such as || or - . The sequence must match the input exactly.
How do I split a string into separate items in a flow?
Use split(text, delimiter) to create the array, then pass that array to Apply to each if you need to process every item. Use an index if you only need a known position.
Can I use split() to parse a CSV file?
Not reliably when fields can contain quoted commas, escaped quotes, or embedded line breaks. A simple split treats each matching delimiter as a boundary, regardless of CSV quoting rules, so use a CSV-aware parsing method for that data.
Related
- Google Sheets SPLIT Function: How to Separate Text
- Oracle Split String Example: SQL Methods That Work
- Balance of Payments: How It Works
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Concatenate in Excel: Formulas, Delimiters, and TipsTo concatenate in Excel means to join text or values into one text string. In Microsoft Excel for…
- Average in Excel: Formula, Examples, and Common FixesTo calculate an average in Excel, use the AVERAGE function: with numbers in B2:B10, enter =AVERAGE(B2:B10). Excel returns…
- XLOOKUP Example Sheet: Formula, Setup, and TipsAn XLOOKUP example sheet can find a value in one column and return the matching value from another.…
- Excel Power Query Split Function: How to Use ItThe Excel Power Query split function is the Split Column command in the Power Query Editor, which divides…
- SUMIF in Excel: Total a Column by One CriterionTo total values in an Excel column when another column meets one condition, use SUMIF. With categories in…
- Different Labels in Word: How to Make Each Label UniqueTo create different labels on one sheet in Microsoft Word, start a label mail merge, connect a recipient…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.