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 / Filter Gallery by user...
Power Apps
Answered

Filter Gallery by user reporting to

(0) ShareShare
ReportReport
Posted on by 269

Hello Guys,

 

Seeking for help on gallery. I want to filter my gallery.

Logs.jpg

This is where I want to pull my data that if I open the App it will shows if a new entry was submitted by the person who is only reporting on me.

 

Members.jpg

and this is the list of members of who were they reporting. 

 

Formula.PNG

and this is the formula I've used to filter who is only reporting on me.

 

i.e: I am logged in as Member ID no 6, and as you can see there is reporting to no. 6 like Member ID no. 8 and 9, and I want to show on my gallery that if Member ID no. 8 or 9 created an item on Leave_Request_Entry list it will show it on the gallery but then if they're not creating a new item it will not appear on the gallery. Most likely  I would like to make the gallery a logs to the one's who is only reporting to that person, if those people who is reporting on him would create a new item it will appear on their reporting to gallery.

 

Thank you!

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Marlin-A 

    Do you want to only show the leave requests for people who Report To person 6?

     

    Put this code in the OnVisible property of the screen

    Set(varUserID, LookUp(Members, Member_Email, User().Email, ID)

     

    Then use this code within the Items property of the gallery displaying leave requests

    Filter(Leave_Request_Entry, Reports_To=varUserID)

     

    ---
    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."
    ---
    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."

  • Marlin-A Profile Picture
    269 on at

    Hello @mdevaney,

     

    I've already created a Set on my OnStart property on App 

    set.PNG

     

    and when I already do the second formula but it is not working on my side.

    error.png

     

    Thank you!

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Marlin-A 
    What column type is Reports_To?  A number type or a lookup type?

     

    Please also share the code you used to define varUserEmail.

  • Marlin-A Profile Picture
    269 on at

    Hello @mdevaney ,

     

    The column type I've used to Reports_To on the Members List is Number, and then I LookUp the Reports_To on the Leave_Request_Entry.

     

    set.PNG

    This is the formula I've made OnStart properties of the App.

     

    Thank you!

     

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Marlin-A 
    Can you go to the App Checker and show me the full message?  It should say something like 'invalid argument type: was expecting text but was given a number instead?'  This is the easiest way to understand what is going on here.

  • Marlin-A Profile Picture
    269 on at

    Hello @mdevaney ,

     

    This is error on the App Checker.

    error.png

    it's just like that.

     

    Thank you!

  • mdevaney Profile Picture
    29,993 Moderator on at

    @WarrenBelz
    Any thoughts on this issue?  To me the original poster's code looks correct.  I must be missing something here. 

  • WarrenBelz Profile Picture
    156,752 Most Valuable Professional on at

    Thanks @mdevaney ,

    I was involved in this a couple of days ago on this post, so know a little of the app.

    The bit added after this is

    Set(
     varReports_To,
     Lookup(
     Members,
     Member_Email = varuserEmail,
     Reports_To
     )
    )

    Is this working?

    Also what is not working - can you please send a screenshot of the code that is getting this error

  • Marlin-A Profile Picture
    269 on at

    Hello again sir @WarrenBelz,

     

    Yes sir that formula is working.

    I can now see which are the members who are reporting on me it is because that It is based on the Members List.

    Formula.PNG

    This formula is used on the gallery to filter who are the persons reporting on me.

     

    And now what am I like to do is that the gallery should be based now on the Leave_Request_Entry list which the Reports_To on the Leave_Request_Entry column was LookUp on the Members list.

     

    Thank you!

  • WarrenBelz Profile Picture
    156,752 Most Valuable Professional on at

    Thanks @Marlin-A ,

    If that is what is not working, then VarUserID and var_ReportsTo should be numeric, but one obviously has ended up a string, so one of these should work

    Filter(
     Members, 
     Value(Reports_To) = varUserID
    )

    or

    Filter(
     Members, 
     Reports_To = Value(varUserID)
    )

     

    or are you saying something else is not working?

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard