Greetings Power Apps Community,
I'm encountering an issue with extracting HTML content from a SharePoint list column and am seeking advice or strategies for dealing with it. My SharePoint list, called wodata, has a column named Items that contains information in an HTML table format. This format encompasses details such as items, unit rates, quantities, and totals, as shown below:
Content from the column is as follows:
and This is content of the column:
<div class="ExternalClass05230F9BE097400790F53A3414976C22"><table border="1" width="100%"><tr><th>Item</th><th>Unit Rate</th><th>Quantity</th><th>Total (USD)</th></tr><tr><td>Purchase of Dongles 4</td><td>$ 44</td><td>8</td><td>$ 352</td></tr><tr><td>Purchase of books</td><td>$ 16</td><td>97</td><td>$ 1552</td></tr><tr><td>Purchase of Cups</td><td>$ 5</td><td>20</td><td>$ 100</td></tr></table></div>
My objective is to transfer this information into a Power Apps collection to enable further manipulation, display, and modification within my application. Nevertheless, I'm finding it challenging to directly parse the HTML content within Power Apps, given the platform's limited HTML parsing capabilities. Specifically, I'm looking to populate a collection with the HTML data when an item is selected for viewing or editing.
Given the restrictions of my Power Apps license, incorporating Power Automate into Power Apps isn't an option for me.
I would greatly appreciate any assistance or alternative solutions that do not involve Power Automate.
@PowerFlames just checking in to see if you were able to get something working for you?
I've previously demo'd the below function during the Power Platform Community Call (specifically back in September 2022)
With({i:
Substitute(Substitute(Substitute(Substitute(Substitute(
ParserJSON.Run(recString.Text).rtntable
, "<td></td>", "<td>null</td>")
, "'", "'")
, "&", "&")
, """, Char(34))
, " ", " ")
},
With({
cols: MatchAll(i, "\<th\>(?<th>.+?)(?=\<\/th\>)\<\/th\>", MatchOptions.Multiline),
rows: MatchAll(i, "\<tr\>(?=\<td)(?<tr>.+?)(?=\<\/tr\>)\<\/tr\>", MatchOptions.Multiline)
},
With({
colsCt: CountRows(cols),
rowsCt: CountRows(rows)
},
With({rcV:
Ungroup(
ForAll(Sequence(rowsCt) As r,
With({
td: MatchAll(Index(rows, r.Value).tr, "\<td\/\>|\<td\>\s*(?<td>.+?)?(?=\s*\<\/td\>)\s*\<\/td\>", MatchOptions.Multiline)
},
{
RW: r.Value,
CV: ForAll(Sequence(colsCt) As c,
{
COL: c.Value,
FLD: Index(cols, c.Value).th,
VAL: With({vC: Index(td, c.Value).td}, If(vC <> "null", Substitute(Substitute(vC,"<","<"),">",">")))
}
)
}
)
),
"CV"
)},
ClearCollect(jsonObjDetails, rcV)
)
)
)
)
The parserJson.Run function is a call to a Power Automate flow to get and return a JSON string as a string of HTML formatted as a Table. Since your string is already formatted as a table, you could manipulate this function to use your string instead of calling the Power Automate flow. Then it should output all the same. (note: you may need to drop the div tags and possibly the table formatting, to get it all to work appropriately.) Once everything was output to the collection, I just used the jsonObjDetails for the items of my gallery.
Let me know if you still need an assist getting this to fit your project.
@NPPlatform thanks for the efforts, but this is HTML table within power apps, but i want fetch from a column in SharePoint list which has few divs as well. it doesn't work for me sadly. I know it's very complex, i hope i'll get someone that can support.
Hi, sadly I don't know of an easy way to go about this. There is, however, a post already on this forum about converting a html-table. You can find it here: https://powerusers.microsoft.com/t5/Building-Power-Apps/Converting-html-table-into-galley/td-p/1926838.
Hopefully this helps you out!
WarrenBelz
106
Most Valuable Professional
MS.Ragavendar
75
Michael E. Gernaey
52
Super User 2025 Season 1