web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Sorting in HTML

(0) ShareShare
ReportReport
Posted on by

Hi, I have a problem with sorting the table in html which is converted to pdf. I tried to use this advice: Solved: FILTER & SORT HTML TABLE IN POWERAPPS - Power Platform Community (microsoft.com)

but it does not work.

What am I doing wrong, I want to sort by column "Grupa"

 

"
<HTML>
<head>
<style> 
table {
width:100%;
 border-collapse: collapse;
}

th, td {
text-align: center;
padding: 5px;

 border: 0.5px solid #465866;
}

h1{color:#4CAF50;}

tr:nth-child(even){background-color: #f2f2f2}

th {
background-color: #465866;
color: white;
}

</style>
</head>
<body>
 
 <pre>
<b><font face = Open Sans color=black>" & Komorka_organizacyjna &"</font></b>
<b><font face = Open Sans color=black>" & Lista_subkonto.Selected.Result &"</font></b>
<b><font face = Open Sans color=black>" & Lista_subkonto_2.Selected.Result &"</font></b>
<b><font face = Open Sans color=black>" & Lista_subkonto.Selected.Result &"</font></b>
</pre>

<H1>Zamówienie</H1>
<table>
<tr>
<th>Lp</th>
<th>Nazwa asortymentu</th>
<th>Liczba</th>
<th>Indeks</th></tr>
" & Concat(
 Zamowienie_lista_2.AllItems;
 
"<tr>
<td>" & rowNum &"</td>
<td align=left>" & Nazwa & "</td>
<td>" & Liczba &"</td>
<td>" & Ind & "</td>
</tr>"
) & "

</Table>
</Body>
</HTML>
"

?

 

Categories:
I have the same question (0)
  • timl Profile Picture
    36,682 Super User 2026 Season 1 on at

    @pablik01 

    You should be able to do this by applying a Sort to the section of code shown below:

    " & Concat(
     Sort(Zamowienie_lista_2.AllItems;Grupa;Ascending); 
    "<tr>

     

  • pablik01 Profile Picture
    on at

    Well, not quite so because then the numbering of lines is not correct

    pablik01_0-1660289143017.png

    Maybe I should rather edit something in the gallery, but I do not know how to enter sorting in this code, all the time throws me an error

     

     

     

    With(
     {
     ThisGallery: Zamowienie_do_eksportu
     };
     ForAll(
     Sequence(CountRows(ThisGallery));
     Patch(
     Last(FirstN(ThisGallery;Value));
     {rowNum:Value}
     )))

     

    in html i tried to use sortbycolums but it doesn't sort

    " & Concat(
     SortByColumns(Zamowienie_lista_2.AllItems;"rowNum";"Grupa");"

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard