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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KathleenW
Regular Visitor

Using try/otherwise to convert HTML to plain text

This is what I have that partially works:

Html.Table([Notes],{{"PlainText",":root"}})

 

But because only some of the entries have the HTML format, it creates an error for the text that doesn't. Can I add try/otherwise to this to get it to work? 

 

Thanks!

2 REPLIES 2
KathleenW
Regular Visitor

I think something else must be wrong with what I'm trying to do. When I expand the table it goes from 1000+ rows to about 25 rows with seemingly no relation to whether it has the <div> wrappers or not. Do you know why that is?

v-rzhou-msft
Community Support
Community Support

Hi @KathleenW ,

 

I have a test in my sample.

1.png

Expand the Table, you see It won't show error if value in [Notes] is not in html format.

2.png

If your code will give you error when values are not in html format. I suggest you to replace error with text error then create a new conditional column by if function.

Right click your PlainText column then use Replace Errors function.

1.png

Add Conditional column as below.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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