cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Timm1
Helper III
Helper III

Employee Directory photo select

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
happyume
Solution Sage
Solution Sage

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.

View solution in original post

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 

 

View solution in original post

4 REPLIES 4
happyume
Solution Sage
Solution Sage

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.

View solution in original post

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 

 

View solution in original post

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?

 

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?

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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