cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SteveZs
Advisor

SharePoint HTML conversion for column values

I'm using a SharePoint 2013 list as a data source, the multiple lines of text column values are being displayed as HTML in the query editor.

 

Sample column value:

 

"<p>​EOD Tuesday<br></p></div>"

 

Is there any way to convert HTML column values to plain text?

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: SharePoint HTML conversion for column values

Well, there is only "Text" in Desktop, no "HTML" format, so my guess is that your column in SharePoint is flagged as Rich Text versus Plain Text so you would need to change the column type in SharePoint, then it should strip out the HTML.

 

I am not aware of anything in DAX or "M" that will strip out HTML from text automagically but I'll look again.

 

Edit: Looks like your best bet is Text.Remove in "M"

https://msdn.microsoft.com/en-us/library/mt260472.aspx

 

You could give it arguments such as "<p>", "</p>", etc but the odds of stripping out all HTML, especially if there are attributes involved is pretty unlikely.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

5 REPLIES 5
Super User
Super User

Re: SharePoint HTML conversion for column values

Well, there is only "Text" in Desktop, no "HTML" format, so my guess is that your column in SharePoint is flagged as Rich Text versus Plain Text so you would need to change the column type in SharePoint, then it should strip out the HTML.

 

I am not aware of anything in DAX or "M" that will strip out HTML from text automagically but I'll look again.

 

Edit: Looks like your best bet is Text.Remove in "M"

https://msdn.microsoft.com/en-us/library/mt260472.aspx

 

You could give it arguments such as "<p>", "</p>", etc but the odds of stripping out all HTML, especially if there are attributes involved is pretty unlikely.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Super User
Super User

Re: SharePoint HTML conversion for column values

SteveZs
Advisor

Re: SharePoint HTML conversion for column values

"change the column type in SharePoint, then it should strip out the HTML"

 

This worked

Highlighted
diverdown1964 Regular Visitor
Regular Visitor

Re: SharePoint HTML conversion for column values

There is a way to handle this elegantly - documented here - https://whitepages.unlimitedviz.com/2018/04/power-bi-report-rich-text-sharepoint/

Merchy2401 Frequent Visitor
Frequent Visitor

Re: SharePoint HTML conversion for column values

This worked like a charm & so easy to do (once you know its there!)

Thanks for sharing!

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 126 members 1,719 guests
Please welcome our newest community members: