Hello,
I’m hoping someone can help. I am trying to create a HTML table with dynamic columns.
Background: I have a SharePoint list that contains readings from our data center power equipment. It is possible that 2 records will be related, but not always. The related records will have the same text in a column named “parenttkt”.
Current Status: I have a gallery holding the SharePoint list records in PowerApps. I built a HTML text form that displays the data of the selected gallery item. See code and Figure 1.
"<!DOCTYPE html>
<html>
<body
<h2 style='text-align: center'>Command Center</h2>
<table style='width:100%'>
<tr>
<th></th>
<th>Record 1</th>
<th></th>
<th>Record 1</th>
<tr>
<td style='width:12%'>UPSA1 Panel:</td>
<td style='padding: 5px; border: 1px solid black; border-collapse: collapse'>" & Concat(galRptBBCPwrOut.Selected.upsa1panel,Value, "; ") & "</td>
<td style='width:12%; padding-left: 15px'>Cat Generator Panel:</td>
<td style='padding: 5px; border: 1px solid black; border-collapse: collapse'>" & Concat(galRptBBCPwrOut.Selected.catgenpanel,Value, "; ") & "</td>
</tr>
<tr>
<td>UPSA2 Panel:</td>
<td style='padding: 5px; border: 1px solid black; border-collapse: collapse'>" & Concat(galRptBBCPwrOut.Selected.upsa2panel,Value, "; ") & "</td>
<td style='padding-left: 15px'>Surge Logic:</td>
<td style='padding: 5px; border: 1px solid black; border-collapse: collapse'>" & galRptBBCPwrOut.Selected.surgelogic & "</td>
</tr>
<tr>
<td>UPSB Panel:</td>
<td style='padding: 5px; border: 1px solid black; border-collapse: collapse'>" & Concat(galRptBBCPwrOut.Selected.upsbpanel,Value, "; ") & "</td>
<td style='padding-left: 15px'>Cmd Ctr Lights:</td>
<td style='padding: 5px; border: 1px solid black; border-collapse: collapse'>" & galRptBBCPwrOut.Selected.cmdctrlights & "</td>
</tr>
</table>
</body>
</html>"
Figure 1:
Problem: If there are related records, I’d to display/add the related record data in the HTML table beside the data from the first. If there is no related record, then I only want to see 1 column. See example/desired outcome below.
I need the most help checking if there is a related record and figuring out how to grab data from both records (either in the gallery or SharePoint). I considered using Power Automate. Any ideas/help is appreciated!!!

Report
All responses (
Answers (