cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pinoq
Helper IV
Helper IV

Filter a gallery base on location

I have a power apps to take staff attendance record. I store the record of the staff from different location in the same list. Now I want to create a manager view in the power apps to check the attendance record of the staff from the same location of the manager. I have a list to store manager mapped by the location. How could I set in the power apps to restrict only manager could click the button to direct to the manager view( I would like to set on the visible property of the button , what I want to know is that , how could I pull the information of from the share-point to get all the manager's email address , I also know how to get the user login email address) , and how could I set the gallery to filter the staff record of that manager? my attendance record have a column to store the staff check in location. 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Pinoq :

Do you mean:

  • Manager is a "person and group" column
  • Manager allow multiple selections

I assume Loaction is a text column in ManagerListSP.Please try:

You can get the manager data by this code:

 

Set(ManagerData,Filter(ManagerListSP,User().Email in Manager.Email))

 

Now you can filter the Attendece Data by this code(I assume Location is a text column in 'AttendanceListSP' and 'ManagerListSP')

 

Filter(AttendanceListSP,Location in ManagerData.Loaction)

 

In addition,you can set the button's OnVisible proeprty to

 

!IsBlank(Filter(ManagerListSP,User().Email in Manager.Email))

 

If the current user is not in the manager list, then this button will not be visible.

Best Regards,

Bof

 

View solution in original post

3 REPLIES 3
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Pinoq ,

see the below approach for your Issue,

First Set the Screen "On Visible" property like below.

First get the Manager Details
Set(ManagerData,Filter(ManagerListSP,Lower(Manager.EMail) = Lower(User().Email))

Now you can filter the Attendece Data Like Below.

Filter(AttendanceListSP,Location=ManagerData.Loaction)

Hope this solution helps you to resolve your issue.


Thanks
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

But how could I set if my column is a multi select column? Cause it will show invalid argument type if I use below equation

 

Set(ManagerData,Filter(ManagerListSP,Lower(Manager.EMail) = Lower(User().Email))

 

Hi @Pinoq :

Do you mean:

  • Manager is a "person and group" column
  • Manager allow multiple selections

I assume Loaction is a text column in ManagerListSP.Please try:

You can get the manager data by this code:

 

Set(ManagerData,Filter(ManagerListSP,User().Email in Manager.Email))

 

Now you can filter the Attendece Data by this code(I assume Location is a text column in 'AttendanceListSP' and 'ManagerListSP')

 

Filter(AttendanceListSP,Location in ManagerData.Loaction)

 

In addition,you can set the button's OnVisible proeprty to

 

!IsBlank(Filter(ManagerListSP,User().Email in Manager.Email))

 

If the current user is not in the manager list, then this button will not be visible.

Best Regards,

Bof

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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