Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
wdchristensen
Specialist
Specialist

Extract Plain Text from HTML

I pulled data from SharePoint and some of the fields contain HTML tags. I am looking for working example. Specifically, I would like something that doesn't require me know what tags will be used in the the data in advance (dynamic solution).  

1 Solution

Accepted Solutions
wdchristensen
Specialist
Specialist
Author

//https://community.powerbi.com/t5/Desktop/Robust-function-to-remove-HTML-tags/td-p/171081

// My data is currently in a resident table called SharePointData_01
For V_Row = 1 to NoOfRows('SharePointData_01')
Let V_ID = Peek('ID',vRow-1,'SharePointData_01');
Let V_PowerBI_To_The_Rescue = Peek('Comments',vRow-1,'SharePointData_01');

do while len(TextBetween(V_PowerBI_To_The_Rescue, '<', '>'))>0
V_PowerBI_To_The_Rescue=Replace(V_PowerBI_To_The_Rescue, '<' & TextBetween(V_PowerBI_To_The_Rescue, '<', '>') & '>', '');
loop;

SharePointData_02:
load
*,
'$(V_PowerBI_To_The_Rescue)' as Comment
Resident SharePointData_01
Where ID=$(V_Row);

next V_Row;

View solution in original post

1 Reply
wdchristensen
Specialist
Specialist
Author

//https://community.powerbi.com/t5/Desktop/Robust-function-to-remove-HTML-tags/td-p/171081

// My data is currently in a resident table called SharePointData_01
For V_Row = 1 to NoOfRows('SharePointData_01')
Let V_ID = Peek('ID',vRow-1,'SharePointData_01');
Let V_PowerBI_To_The_Rescue = Peek('Comments',vRow-1,'SharePointData_01');

do while len(TextBetween(V_PowerBI_To_The_Rescue, '<', '>'))>0
V_PowerBI_To_The_Rescue=Replace(V_PowerBI_To_The_Rescue, '<' & TextBetween(V_PowerBI_To_The_Rescue, '<', '>') & '>', '');
loop;

SharePointData_02:
load
*,
'$(V_PowerBI_To_The_Rescue)' as Comment
Resident SharePointData_01
Where ID=$(V_Row);

next V_Row;