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.

Marcel Lehmann

Marcel Lehmann

Microsoft MVP Microsoft MVP

BizzApps MVP from Switzerland πŸ‡¨πŸ‡­ - PowerPlatform Expert & Evangelist & MVP - Turning passion into expertise

MVP since 2023 β€’ Power Platform Expert since 2017