How to Extract a Specific Line from an Email in Power Automate
Question details
The user wants to extract a dynamic value from a consistent line in an incoming email and save it to Microsoft Lists using Power Automate, even when there are no explicit delimiters.

- Product
- Microsoft Power Automate
- Device & OS
- not provided
- Scenario
- Parsing automated emails without clear delimiters to extract variable text data and automatically populate a Microsoft List.
- Observed behavior
- The goal is to successfully isolate the target text string from the email body regardless of changing values and dynamically pass it to the next workflow action.
Ensure you have an active Microsoft Power Automate account and a destination Microsoft List already configured to receive the extracted data.
Use Text Functions to Isolate the Email Line
Use built-in string expressions like split and substring to parse the plain text email body and extract the targeted line.
When an email has a consistent structure but no clear delimiters (like commas or colons), converting the email to plain text and utilizing the split() function is the most reliable way to extract a specific line or value.
Start your flow by adding the 'When a new email arrives (V3)' trigger. Configure the folder and sender filters to target the specific emails you want to parse.
Add the 'Html to text' action to your flow. Map the dynamic content 'Body' from your email trigger into this action to remove complex HTML formatting and normalize the text.
Add a 'Compose' action. Use the split() expression to divide the text string. For example, if the value always follows 'Name:', use the expression split(outputs('Html_to_text'), 'Name:') to create an array.
Add another 'Compose' action and use the last() or first() function combined with another split() to remove the trailing text (such as a line break). An expression like split(last(outputs('Compose_1')), decodeUriComponent('%0A'))[0] will isolate the exact line.
Add a 'Create item' action for Microsoft Lists. Map the output from your final Compose action into the appropriate list column to save the extracted value.

Boost Your Productivity with WPS Office
While Power Automate handles complex automated workflows, for your daily document processing, spreadsheet management, and presentation needs, WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Suite: Run the setup file and follow the quick on-screen instructions to install the software on your device.
- 3. Open Your Office Files: Launch WPS Office to immediately view, edit, and create Word, Excel, and PowerPoint files with full format compatibility.

Frequently Asked Questions
What if the email formatting changes frequently?
If the email structure is inconsistent, basic split functions may fail. Consider using AI Builder or premium third-party parsing connectors in Power Automate to extract entities from variable text intelligently.
Can I extract multiple lines from the same email?
Yes, you can use multiple 'Compose' actions with different split expressions to extract various data points from the same converted plain text body simultaneously.
How do I handle blank spaces in the extracted text?
You can wrap your extraction expression in the trim() function. For example, trim(outputs('Compose')) will remove any leading or trailing whitespace from the extracted value before saving it.




