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.


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.


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

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
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 113 members 1,744 guests
Please welcome our newest community members: