Forum Discussion
How to remove html tags from some rows.
Hello
I have a report that has web addresses in it. The addresses that go to a SharePoint site are fine, but the ones that point to a document have <Div class="external....... stuff before and after the web address. Everything I have tried (custom columns, extracts etc) have ended up stripping out the rows that are fine. How do I fix just the rows that are problems and leave the rows that are fine?
I was able to make a work around my changing my colomn type in the SharePoint list itself.
4 Replies
- AmiraBedhSuper User
Can you share your data ? an example of the rows containing html tags?
- RBettinelliFrequent Visitor
I've had to change it a bit so I can share it, but its basically this.
Data Sources https://collaboration.ca/sites//SitePages/Home.aspx?web=1 https://collaboration.ca/sites//SitePages/Home.aspx?web=1 https://collaboration.ca/sites//SitePages/Home.aspx?web=1 https://app.powerbi.com/groups/me/apps/cf8d9210-8aaa-4e69-a991-a5073bcf2509/reports/b95a573b-fcc0-438f-b922-8217e0c68a2c/ReportSection?experience=power-bi https://collaboration.ca/sites//SitePages/Home.aspx?web=1 null https://app.powerbi.com/groups/me/apps/cf8d9210-8aaa-4e69-a5073bcf2509/dashboards/ec65c01e-89a6-4d5b-aa54-2838cd725823?experience=power-bi https://collaboration.ca/sites/PI%20Dashboards%20%20Reports/Program%20Inventory%20Summary%20Dashboard%20FY%202022-23.pdf https://collaboration.ca/sites/PI%20Dashboards%20%20Reports/Program%20Inventory%20Detailed%20Report%20FY%202022-23.pdf https://collaboration.ca/sites/DRPRM-DPRGR/Lists/L1%20Contact%20List/AllItems.aspx?viewid=16da80ca-3cd8-4ee9-a57d-5ba6d8104e19&useFiltersInViewXml=1&web=1 <div class="ExternalClass48A2FB7E4CCF4A14BD26D4E5E63F255E"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);"><a href="https://collaboration.ca/sites/Public%20Documents/Forms/AllItems.aspx?csf=1&e=jvpUGa&web=1&RootFolder=/sitesR/Public%20Documents/Business%20Planning/BP%20Cycle%20Docs/BP%202024-25/L1%20Subs&FolderCTID=0x012000DA5BB5821A5BB54BA8E22E8C99761EC8">Directorate Resource Planning & Risk Management - DRPRM - L1 Subs - All Documents ()</a><br></div></div> <div class="ExternalClassEB63DF80908F47A8B9317FF87A2D1554"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);"><a href="https://collaboration.ca/sites/Public%20Documents/Forms/OE%20Dir.aspx?csf=1&e=OcVPoh&RootFolder=/sitesPublic%20Documents/Organization%20and%20Establishment%20Directive%20-%20Directive%20sur%20L%e2%80%99organisation%20et%20les%20Effectifs&FolderCTID=0x01200054A6647BE5A4FE46B4C01EFC6010CC02">Director Defence Force Planning (DDFP) - Organization and Establishment Directive - Directive sur L’organisation et les Effectifs - O&E Dir ()</a><br></div></div> <div class="ExternalClass8DD2F5CACECA410B8697A81B3D4E5513"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);"><a href="https://collaboration.ca/sites/DGDFP/DDFP/MOO/Forms/Default.aspx">MOO - Default ()</a><br></div></div> <div class="ExternalClass1C1786A275B341298D0081D2D0CC3550"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);"><a href="https://collaboration.ca/sites/Public%20Documents/Forms/AllItems.aspx"> - Public Documents - All Documents ()</a><br></div></div>
- AnonymousNot applicable
Hi RBettinelli ,
Maybe you can try formula like below:
ExtractedURL = IF ( CONTAINSSTRING ( 'Table'[URL], "div" ), VAR StartPosition = FIND ( "href", 'Table'[URL] ) + 6 VAR EndPosition = FIND ( ">", 'Table'[URL], StartPosition ) RETURN MID ( 'Table'[URL], StartPosition, EndPosition - StartPosition-1 ), 'Table'[URL] )Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- RBettinelliFrequent Visitor
I was able to make a work around my changing my colomn type in the SharePoint list itself.