TL;DR: Turn a multiline text block into a loopable array in Power Automate with
split(text, separator).
π‘ Challenge
How do you process a copied multiline text block, each line a record (IDs, email addresses, URLs), in a Power Automate flow without splitting it by hand? Manual steps donβt scale and are error-prone.
β Solution
Use the split() expression to turn the multiline string into an array. With a simple separator (a line break, comma, or any character) you get an array you can loop through with βApply to eachβ.
π§ How Itβs Done
1. Capture the text
πΈ Add a Compose action and paste your multiline text into it. Name it DataInput.
2. Define the separator
πΈ Add a second Compose containing only a line break (press Enter in the input). Name it Separator.
3. Loop the array
πΈ Add an Apply to each control and set its input to:
split(outputs('DataInput'), outputs('Separator'))
4. Process each line
πΈ Inside the loop, use Current item to trim, validate, call an API, or create records.
π Result
Your flow now accepts any multiline text block and processes each line as a separate item. No more copy-paste, no manual cleanup, just reliable automation that scales.
π Key Advantages
πΈ Saves time by automating repetitive data preparation
πΈ Flexible: works with lists from Excel, emails, Power Apps, or paste operations
πΈ Reduces human errors from manual handling
πΈ Scales to hundreds or thousands of lines without extra effort
π₯ Video Tutorial
π οΈ FAQ
1. What if my data is comma-separated instead of line breaks?
Replace the Separator Compose content with a comma. The same split() expression produces the array.
2. Can the text originate from a Power App? Yes. Pass a multiline text input from Power Apps into the flow; the split logic stays identical.
3. How do I handle empty lines from accidental extra newlines?
Add a condition inside the loop to check that trim(Current item) is not empty before processing.
π Related Tips
- #PowerPlatformTip 120: PowerAutomate Text Processing 2.0, advanced text manipulation actions.
- #PowerPlatformTip 24: Merge Arrays or Tables, combine arrays after splitting.