cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

PowerApps: How to print/insert content of nested table in HTML?

I have a collection created using the following query in PowerApps:
ClearCollect(MyTable,ForAll(ToolsMasterVersion2,If(!('{Name}' exactin ABCTable.ToolNumber),{ToolNumber:'{Name}',ContactPerson:ContactPerson1})));

Then, I created grouped collection:

ClearCollect(groupedMyTable,GroupBy(MyTable,"ContactPerson","ToolNumber"));

How can I use groupedMyTable content such that for each "Contact Person" corresponding "ToolNumber" is inserted/printed in the following HTML code?

"<table width='100%'> " &
      "<tr>
          <td> Report Generated by: </td><td>" & User().FullName & "</td>" &
            "</tr>" &
      "<tr>
          <td> Date Generated: </td> <td>" & Today() & "</td>
      </tr>" &
 "</table> <br>" &

"<strong> Items: </strong>" &
 "<table width='100%' border='1' cellpadding='5' style='border:3px solid black; border-collapse:collapse'>" &
      "<tr style='background-color:red'>
          <th> Tool Name </th>
      </tr>
      <tr>" &
          Concat(Sort(MyTable,ToolNumber), "<td>" & ToolNumber & " " & ContactPerson & " </td><tr>" )&
 "</table>"

****************************************************************************************************************

The desired out put is:

Person *************************  ToolNumber

ABC                                           1234

                                                  4567

                                                  9876

xyz                                             6789

                                                   4432

                                                   7892

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to insert the grouped collection into the HTML text control within your PowerApps app?

 

I have made a test on my side and I afraid that there is no way to achieve your needs in PowerApps app currently. There is no way to insert a grouped collection into a HTML text control within a PowerApps app currently. In addition, the HTML text control only supports inserting Text, Boolean and Number value currently.

 

Currently, we could only insert corresponding "TotalNumber" value for each "ContactPerson" into the HTML text control as below:7.JPG

The HtmlText property of the HTML text control set to following formula:

"<table width='100%'> " &
      "<tr>
          <td> Report Generated by: </td><td>" & User().FullName & "</td>" &
            "</tr>" &
      "<tr>
          <td> Date Generated: </td> <td>" & Today() & "</td>
      </tr>" &
 "</table> <br>" &

"<strong> Items: </strong>" &
 "<table width='100%' border='1' cellpadding='5' style='border:3px solid black; border-collapse:collapse'>" &
      "<tr style='background-color:red'>
        <td>ContactPerson</td>
        <td>ToolNumber</td>
      </tr>
      <tr>" &Concat(Sort(MyTable,ContactPerson), "<td>" & ContactPerson & "</td><td>" & ToolNumber & " </td><tr>" )&
 "</table>"

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

 

Best regards,

kris

Community Support Team _ Kris Dai
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-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to insert the grouped collection into the HTML text control within your PowerApps app?

 

I have made a test on my side and I afraid that there is no way to achieve your needs in PowerApps app currently. There is no way to insert a grouped collection into a HTML text control within a PowerApps app currently. In addition, the HTML text control only supports inserting Text, Boolean and Number value currently.

 

Currently, we could only insert corresponding "TotalNumber" value for each "ContactPerson" into the HTML text control as below:7.JPG

The HtmlText property of the HTML text control set to following formula:

"<table width='100%'> " &
      "<tr>
          <td> Report Generated by: </td><td>" & User().FullName & "</td>" &
            "</tr>" &
      "<tr>
          <td> Date Generated: </td> <td>" & Today() & "</td>
      </tr>" &
 "</table> <br>" &

"<strong> Items: </strong>" &
 "<table width='100%' border='1' cellpadding='5' style='border:3px solid black; border-collapse:collapse'>" &
      "<tr style='background-color:red'>
        <td>ContactPerson</td>
        <td>ToolNumber</td>
      </tr>
      <tr>" &Concat(Sort(MyTable,ContactPerson), "<td>" & ContactPerson & "</td><td>" & ToolNumber & " </td><tr>" )&
 "</table>"

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

 

Best regards,

kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Kris, Thanks for the reply. I have opened "New Idea" as suggested by you.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,504)