Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Manasi25
Helper II
Helper II

extract data from text body which has html text

hello team,

I have email data which has Body with text & html, I filtered only text data and its giving me text body.

In the text body, i wanted to extract the original email body, which has an HTML preview table.

Please advise !

Email Body - i want highlited table into power query.

Manasi25_0-1750228066125.png


Power query extracted -

Manasi25_1-1750228125085.png

 






2 REPLIES 2
burakkaragoz
Community Champion
Community Champion

Hi @Manasi25 ,

 

I see what you’re running into. Basically, Power Query is only pulling the plain text version of your email body and missing the HTML-formatted table (like the one you highlighted in your screenshot). By default, Power Query’s email connector or even M code will often just grab the text part, not the HTML, which is why you’re not getting the rich table.

What you want is to extract data from the HTML body, specifically the table, and load that into Power Query. Here’s how I’d approach it:

  • Make sure you’re actually pulling the HTMLBody property, not just the Body or TextBody. Sometimes the connector or source will give you both, but you might need to switch to the HTMLBody field.
  • Once you have the HTML, you can use Power Query’s “From Web” or “From File” to load the HTML as text, then use the “Extract Table Using Examples” feature, or write a bit of M code to parse the table tags (<table>, <tr>, <td>). Power Query can actually parse HTML tables pretty well if you feed it the right part.
  • If you still only get text, try exporting the email as an .eml or .msg file, then open it with Power Query and pick out the HTML part.

Basically, you want to get the raw HTML into Power Query, then extract the table. The tricky part is making sure you’re not just stuck with the plain text. If your connector doesn’t support HTMLBody, you might need to save emails out and process them manually.

 

If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

Thank you, will try it.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.