cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KQ
Frequent Visitor

FILTER & SORT HTML TABLE IN POWERAPPS

Good afternoon!  I have jumped ahead of my skill base here, but I am trying to filter and sort a html table.

Here is the code of the html table:

"<h3>Equipment History This Job</h3>" &

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<th>Job No</th>
<th> Status </th>
<th> Equip ID </th>
<th>Date </th>
<th>Appt ID</th>
</tr>
<tr>" &
Concat(Equipment,
"<td>" & JOB_NO & " </td>
<td>" & EQUIP_STATUS & " </td>
<td>" & EQUIP_ID & " </td>
<td>" & DATE & " </td>
<td>" & APPT_ID & " </td>","</tr><tr>") &


"</table>"

 

This produces a lovely table, just what I need, except I need to apply the following sort/filter:

SortByColumns(
Filter(Equipment,JOB_NO=DataCardValue12.Text),"APPT_ID",Descending)

 

I have applied this to a DataTable, which displays perfectly, but as I want to include this exact data table into an email, I need to recreate it as HTML code but do not know where/how to put the sort/filter function.

 

Hoping you can help?  🙂

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @KQ ,

 

Try to replace the Equipment with this formula in HTML table:

"<h3>Equipment History This Job</h3>" &

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<th>Job No</th>
<th> Status </th>
<th> Equip ID </th>
<th>Date </th>
<th>Appt ID</th>
</tr>
<tr>" &
Concat(SortByColumns(
Filter(Equipment,JOB_NO=DataCardValue12.Text),"APPT_ID",Descending),
"<td>" & JOB_NO & " </td>
<td>" & EQUIP_STATUS & " </td>
<td>" & EQUIP_ID & " </td>
<td>" & DATE & " </td>
<td>" & APPT_ID & " </td>","</tr><tr>") &


"</table>"

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @KQ ,

 

Try to replace the Equipment with this formula in HTML table:

"<h3>Equipment History This Job</h3>" &

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<th>Job No</th>
<th> Status </th>
<th> Equip ID </th>
<th>Date </th>
<th>Appt ID</th>
</tr>
<tr>" &
Concat(SortByColumns(
Filter(Equipment,JOB_NO=DataCardValue12.Text),"APPT_ID",Descending),
"<td>" & JOB_NO & " </td>
<td>" & EQUIP_STATUS & " </td>
<td>" & EQUIP_ID & " </td>
<td>" & DATE & " </td>
<td>" & APPT_ID & " </td>","</tr><tr>") &


"</table>"

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
KQ
Frequent Visitor

Excellent!  Thank you very much 🙂

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,129)