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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Skip a HTML Table Row ...
Power Apps
Unanswered

Skip a HTML Table Row if data is blank?

(1) ShareShare
ReportReport
Posted on by 22
I'm using a HTML Element to display a table of data that's retrieved from a Sharepoint List.
The HTML table is currently templated for 5 rows of data.
But sometimes only 1 or 2 rows are needed so I'd like to skip blank rows if the first data check is blank.
 
My HTML row looks like this:
<tr>
<td style='width: 93px;'>" & sideGal.Selected.'Name 02:' & "</td>
<td style='width: 120px;'>" & sideGal.Selected.'ID 02:' & "</td>
</tr>
 
 
I assume I need something like:
// This is row 2 inside of already existing HTML so use an ampersand/& to interrupt
& If(!IsBlank(sideGal.Selected.'Name 02:'), [TABLE ROW CODE HERE]) & /* back to HTML */
 
But I'm struggling to combine the Power App code with the HTML.
 
Can anyone assist, please?
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    Is there a reason why HTML control is required to display a table?
    You can make use of the Table control and just update the Items property with your SharePoint List.
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
  • PT-19081038-0 Profile Picture
    22 on at
    @Nandit 
    A Data Table doesn't allow for any sort of customisation (as far as I can tell). And creates one long row of data which isn't readable.
  • Suggested answer
    CA1105 Profile Picture
    545 Super User 2025 Season 2 on at
    May be you can create one variable with the HTML which you are getting from SharePoint list and remove those rows which are not needed and then bind HTML control with that variable?
  • Suggested answer
    timl Profile Picture
    36,383 Super User 2025 Season 2 on at
    Hi PT-19081038-0
     
    I think you're close with your If statement. I'd suggest something like this:
     
    "<Table>"
     & If(
        !IsBlank(sideGal.Selected.'Name 01:'),
        "<tr>
            <td style='width: 93px;'>" & sideGal.Selected.'Name 01:' & "</td>
            <td style='width: 120px;'>" & sideGal.Selected.'ID 01:' & "</td>
        </tr>"
    ) &
    If(
        !IsBlank(sideGal.Selected.'Name 02:'),
        "<tr>
            <td style='width: 93px;'>" & sideGal.Selected.'Name 02:' & "</td>
            <td style='width: 120px;'>" & sideGal.Selected.'ID 02:' & "</td>
        </tr>"
    ) &
    If(
        !IsBlank(sideGal.Selected.'Name 03:'),
        "<tr>
            <td style='width: 93px;'>" & sideGal.Selected.'Name 03:' & "</td>
            <td style='width: 120px;'>" & sideGal.Selected.'ID 03:' & "</td>
        </tr>"
    ) &
    If(
        !IsBlank(sideGal.Selected.'Name 04:'),
        "<tr>
            <td style='width: 93px;'>" & sideGal.Selected.'Name 04:' & "</td>
            <td style='width: 120px;'>" & sideGal.Selected.'ID 04:' & "</td>
        </tr>"
    ) &
    If(
        !IsBlank(sideGal.Selected.'Name 05:'),
        "<tr>
            <td style='width: 93px;'>" & sideGal.Selected.'Name 05:' & "</td>
            <td style='width: 120px;'>" & sideGal.Selected.'ID 05:' & "</td>
        </tr>"
    ) & "</table>"
    
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard