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 Platform Community / Forums / Power Apps / Export filtered Galler...
Power Apps
Answered

Export filtered Gallery to html text control

(0) ShareShare
ReportReport
Posted on by 11

Hi Community, 

 

I have an employee list in a gallery, which I'm filtering by the manager's name. I would like to show that filtered list in an HTML text control to be emailed. 

 

The problem I'm having is that only the selected row on the gallery is showing in the HTML text control. 

powerapptest.png
Categories:
  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @jcesquivel950 ,

     

    Hope this Blog helps

  • jcesquivel950 Profile Picture
    11 on at

    Hi Ethan, 

     

    Now, I am able to show the list following the example in your link, It's pulling all the data. How I will be able to filter the list?

     

    here is my code:

     

    With(
    {
    BGColor: "#2196F3",
    TextColor: "white"
    },
    "<table style='border-collapse: collapse; width: 100%;'>" &
    "<thead style='border-bottom: 1px solid black;'>" &
    "<tr><th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Employee Name</th>" &
    "<th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Role</th>" &
    "<th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Manager</th></tr></thead>" &
    "<tbody>" &
    Concat(HJ1users, "<tr><td style='border: 1px solid black; padding: 5px;'>" & 'User Name' & "</td>" &
    "<td style='border: 1px solid black; padding: 5px;'>" & Role & "</td>" &
    "<td style='border: 1px solid black; padding: 5px;'>" & Manager & "</td></tr>") &
    "</tbody></table>"
    )

  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @jcesquivel950 

    If you want to show only the items that appear in the gallery, you can Concat the AllItems property of the gallery like so:

    With(
    {
    BGColor: "#2196F3",
    TextColor: "white"
    },
    "<table style='border-collapse: collapse; width: 100%;'>" &
    "<thead style='border-bottom: 1px solid black;'>" &
    "<tr><th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Employee Name</th>" &
    "<th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Role</th>" &
    "<th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Manager</th></tr></thead>" &
    "<tbody>" &
    Concat(YourGallery.AllItems, 
     "<tr><td style='border: 1px solid black; padding: 5px;'>" & 'User Name' & "</td>" &
     "<td style='border: 1px solid black; padding: 5px;'>" & Role & "</td>" &
     "<td style='border: 1px solid black; padding: 5px;'>" & Manager & "</td></tr>") & 
     "</tbody></table>"
    )

     

    If you want to filter the output by some other condition, you can call the Filter function.

    With(
    {
    BGColor: "#2196F3",
    TextColor: "white"
    },
    "<table style='border-collapse: collapse; width: 100%;'>" &
    "<thead style='border-bottom: 1px solid black;'>" &
    "<tr><th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Employee Name</th>" &
    "<th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Role</th>" &
    "<th style='border: 1px solid black; padding: 5px; text-align: left; background-color: "&BGColor&"; color: "&TextColor&";'>Manager</th></tr></thead>" &
    "<tbody>" &
    Concat(Filter(Hj1Users, ManagerName="Alex"), 
     "<tr><td style='border: 1px solid black; padding: 5px;'>" & 'User Name' & "</td>" &
     "<td style='border: 1px solid black; padding: 5px;'>" & Role & "</td>" &
     "<td style='border: 1px solid black; padding: 5px;'>" & Manager & "</td></tr>") & 
     "</tbody></table>"
    )
  • jcesquivel950 Profile Picture
    11 on at

    Thank you very much guys. It's working now. 

     

    The blog to work with the HTML control helped me a lot. Also, the second reply fixed my code.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard