logo
search
Others

How to Extract a Specific Line from an Email in Power Automate

Aamir Naveed AkramAamir Naveed Akram Sep 25, 2026 868 views

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.

Extracting a Specific Line from an Email in Power Automate
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.
Before you start

Ensure you have an active Microsoft Power Automate account and a destination Microsoft List already configured to receive the extracted data.

Solution 1Recommended

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.

1
Add an Email Trigger

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.

2
Convert to Plain Text

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.

3
Create a Compose Action for Splitting

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.

4
Isolate the Target Value

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.

5
Update Microsoft Lists

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.

Use Text Functions to Isolate the Email Line
Community Support: For highly specialized guidance or complex expression troubleshooting, consulting the Microsoft Power Platform Community forums is highly recommended.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Suite: Run the setup file and follow the quick on-screen instructions to install the software on your device.
  3. 3. Open Your Office Files: Launch WPS Office to immediately view, edit, and create Word, Excel, and PowerPoint files with full format compatibility.
Seamlessly compatible with Microsoft Office formats like DOCX, XLSX, and PPTX.Lightweight installation and incredibly fast startup times for daily tasks.All-in-one tabbed interface to manage documents, spreadsheets, and PDFs in a single window.Free to use with a familiar user interface that requires no learning curve.
microsoft office alternative - wps office

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.