How to Use Split Function in Power Automate

Formulas & functions · Updated November 23, 2026

The split() function in Power Automate breaks a string into an array of substrings based on a delimiter you specify. It is essential for parsing CSV data, extracting values from log lines, or splitting email addresses from a semicolon-separated list. You use it directly in expressions—no premium connector or extra license required. This guide walks you through the syntax, real-world examples, and common pitfalls.

What You’ll Need

  • A Power Automate flow (cloud flow) with a trigger—any trigger works, such as ‘When a new email arrives’ or ‘When an item is created’.
  • A string value to split. This can come from a trigger output, a variable, or a literal string you type.
  • Basic familiarity with the expression editor (the ‘fx’ tab in the dynamic content picker).

Step-by-Step

  1. Open your flow in edit mode. In Power Automate (make.powerautomate.com), select your flow and click Edit.
  2. Add an action where you want the split result. For example, add a ‘Compose’ action (under Data Operation) or a ‘Apply to each’ loop. The split function is usually used inside an expression that feeds into an action.
  3. Open the expression editor. Click inside the field where you want the result (e.g., the ‘Inputs’ field of a Compose action). Then click the fx tab (Expression) in the dynamic content panel.
  4. Type the split expression. The syntax is: split('text to split', 'delimiter'). For example, to split a comma-separated list, type:
    split('apple,banana,cherry', ',')
    This returns an array: ['apple', 'banana', 'cherry'].
  5. Use dynamic content as the input. Instead of a literal string, reference a trigger output. For instance, if you have a field named ‘Names’ with semicolons, your expression becomes:
    split(triggerOutputs()?['body/Names'], ';')
    Note the use of ?[''] for safe property access.
  6. Store the result in a variable (optional). If you need the array multiple times, initialize a variable (type Array) and set it to the split expression. Add an action Initialize variable, set Type to Array, and in Value put the expression.
  7. Iterate over the array with ‘Apply to each’. Add an ‘Apply to each’ action. In the ‘Select an output from previous steps’ field, choose the array variable or the expression output. Inside the loop, use item() to reference each split element.
  8. Handle empty delimiters. If you need to split every character, use an empty string as the delimiter: split('abc', '') gives ['a', 'b', 'c'].

Common Mistakes

  • Using quotes incorrectly. In expressions, strings must use single quotes, not double quotes. Double quotes are for JSON. Wrong: split("a,b", ",") — this fails. Correct: split('a,b', ',').
  • Forgetting that the delimiter is case-sensitive. split('A,B', 'a') returns the whole string as one element because ‘a’ is not found.
  • Assuming split modifies the original string. It returns a new array; the original string remains unchanged.
  • Using split on a null value. If the input string is null, the expression throws an error. Use coalesce() to provide a default, e.g., split(coalesce(triggerOutputs()?['body/field'], ''), ',').
  • Expecting split to trim spaces. split('a, b', ',') gives ['a', ' b']—note the leading space. Use trim() inside a loop if needed.

Tips

  • Use split with first() and last() to extract specific elements. For example, to get the domain from an email: last(split('user@example.com', '@')) returns ‘example.com’.
  • Combine with join() to reverse the operation. join(split('a,b,c', ','), ' | ') gives ‘a | b | c’.
  • For CSV data, consider the ‘Parse CSV’ action instead. It handles quoted fields and line breaks better than a simple split.
  • Test your expression in the flow checker. Use the ‘Test’ button with sample data to see the array output before adding more logic.
  • When using split inside a loop, be careful with the item() function. If you split a string inside a loop, the result is an array, so you need another loop or use item() to get the string first.

Troubleshooting

  • Expression returns an error like ‘The template language function ‘split’ expects its first parameter to be a string’. This means the input is not a string—it might be an object or an array. Convert it with string() if it’s a number or boolean, or check the source field.
  • My array appears as a single item. Check that the delimiter exactly matches the character in the string. For example, if your string uses a tab, you need to use the tab character in the delimiter—copy-paste it or use char(9) (but note char() is not available in all contexts; you can use the actual tab character).
  • Split works in Compose but not in a variable. Ensure the variable type is Array. If you set it to String, the array will be converted to a JSON string like ‘[“a”,”b”]’.
  • When using split with dynamic content, the expression is not accepted. Make sure you are in the expression editor, not the dynamic content editor. Also check that the dynamic content field is a string—some fields are objects.
  • Split returns an array with empty elements. If your string has consecutive delimiters, e.g., ‘a,,b’, split returns [‘a’, ”, ‘b’]. To filter out empties, use a filter array action or a condition inside a loop.

Frequently Asked Questions

Q: Can I split by multiple delimiters at once?
A: No, the split function only accepts a single delimiter. To split by multiple characters, first replace one delimiter with another using replace(), then split. For example, to split by both comma and semicolon: split(replace('a,b;c', ';', ','), ',').

Q: How do I split a string into individual characters?
A: Use an empty string as the delimiter: split('hello', '') returns [‘h’, ‘e’, ‘l’, ‘l’, ‘o’].

Q: What is the difference between split and substring?
A: substring() extracts a portion of a string based on a start index and length. split() breaks the whole string into an array based on a delimiter. Use split when you need to process all parts; use substring when you know the exact position.

Q: Can I use split in a condition?
A: Yes, but you need to check the array’s length or contains. For example, to see if a string contains a comma: greater(length(split(myString, ',')), 1).

Q: Does split work with multiline strings?
A: Yes, but the delimiter must match the line break character. Use split(myString, char(10)) for newlines (line feed) or char(13) for carriage return. In some cases you need both.

Q: How do I get the first element of a split result?
A: Use first(split(myString, ',')). Similarly, last() gets the last element.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

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

Spotted an error in this guide? Let us know.