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 / Employee Directory pho...
Power Apps
Answered

Employee Directory photo select

(0) ShareShare
ReportReport
Posted on by 302

Hi there!

I’m building an employee directory in Powerapps. I have it when a user type in a name in the txtEmployeeName search box, it will display that user’s information with a photo in galMain gallery.  Also, another Gallery for the manager (galManager) and direct reports (galDirect) for that selected user. What would be the best way to do the OnSelect when they click on a Manager or Direct Report’s photo, that selected user  populate into the galMain and have it show their manager and directs? For example, I click on Charlie Brown's photo from the Direct Reports, He will show up in the galMain and show his information.   Below are the formulas for the galleries.

Timm1_0-1628793477595.png

galMain Items - Filter(Office365Users.SearchUser({searchTerm:txtEmployeeName.Text}),IsBlank(Department)= false,AccountEnabled=true)

galManager Items - Office365Users.Manager(galMain.Selected.UserPrincipalName)

galDirect Items - Office365Users.DirectReports(galMain.Selected.UserPrincipalName)

Photos - Office365Users.UserPhoto(ThisItem.UserPrincipalName)

 

Thank you for your time.

Tim

Categories:
I have the same question (0)
  • Verified answer
    Mitanshu Profile Picture
    1,658 Moderator on at

    Try following 3 steps solution and please let us know if it works:

    1 - For the OnVisible property of your App Screen, Set(selectedUser, User().FulllName)


    2 - Default value of your textbox = selectedUser


    3 - OnSelect property for manager photo/name or direct report photo/name should be Set(selectedUser,ThisItem.UserPrincipalName)

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    Timm1 Profile Picture
    302 on at

    That is what I was looking for.  I need to do some tweaking to add a button to navigate back but this is working.  Thank you very much1 

     

  • Timm1 Profile Picture
    302 on at

    I have one more question.  I made a combo box so the user can select one from all of the employees listed. The name of that combo box is cmbName and the code for that combo box is Office365Users.SearchUser({searchTerm:cmbName.SearchText,top:400}).  

    The galMain code is Filter(Office365Users.SearchUser({searchTerm:cmbName.Selected.GivenName}),IsBlank(Department)= false,AccountEnabled=true)

     

    Can I do this same solution with a combo box instead of a text box?  Might need to add an "IF" statement?

     

  • Timm1 Profile Picture
    302 on at

    Thank you so much!  I have one more question.  I made a combo box so the user can select one from all of the employees listed. The name of that combo box is cmbName and the code for that combo box is Office365Users.SearchUser({searchTerm:cmbName.SearchText,top:400}).  

    The galMain code is Filter(Office365Users.SearchUser({searchTerm:cmbName.Selected.GivenName}),IsBlank(Department)= false,AccountEnabled=true)

     

    Can I do this same solution with a combo box instead of a text box?  Might need to add an "IF" statement?

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard