Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Filter Gallery based on related table

(0) ShareShare
ReportReport
Posted on by 79

This might be due to a learning curve going over to dataverse, but I am having issues with a table that tracks objects. Many Users can be Assigned to Many Objects. 

I have created a relationship between my table and the User Table. I am able to relate/unrelate users between the tables, but I can’t seem to figure out how to sort a gallery so that the current user only sees objects related to them. 

Nothing special column wise I am simply relating the user to the object. I have been able to look up that user within a comboxbox in the gallery but I cannot filter off it. I’ve tried converting the output of the combo box to a text box, looking it up within a text box, and I’ve tried filtering off the combo box with no luck. I’ve tried to look up how information about the users table to make sure I am using the correct relationship but havnt had much luck other than the generic info on MS learn. Anyone have any ideas on a filter set up or if I’m just flat out doing something wrong? 

example Filter(myTable, lookUp(users, ‘primary email’ = textbox.text)

Categories:
  • Verified answer
    hitty08 Profile Picture
    79 on at
    Re: Filter Gallery based on related table

    End up following the guide in this link to resolve filtering a gallery based on related items in a n:n relationship 

     

    https://powerapps.microsoft.com/en-us/blog/option-sets-and-many-to-many-relationships-for-canvas-apps/

  • hitty08 Profile Picture
    79 on at
    Re: Filter Gallery based on related table

    Sorry first time posting a data-verse question, because this a many to many relationship technically all of the Users are just related to myTable so I have no ID to reference within my original table. 

    myTable N:N relationship with Users Table where I relate the user.

     

    In the text input in the gallery I am currently running the following to filter the other users that are assigned to the same object. 


    On the text input within the gallery -

    lookup(ThisItem.Users,’Primary Email’ = varUsrEmail,’Primary Email’) 

     

    On the items property of the gallery 

    Filter(myTable, varUsrEmail = lookup(Users,’Primary Email’ = TextInput.Text).’Primary Email’)

     

    I just created a one to many relationship with the users table also trying to target the IDs 

     

    - set a global variable to get the current user ID via Office365 users 

    - then I targeted the ‘Application ID’ in the users table 

     

    No luck 

  • hitty08 Profile Picture
    79 on at
    Re: Filter Gallery based on related table

    Sorry should have been a bit clearer on the relationship n:n

  • v-mingkz-msft Profile Picture
    Microsoft Employee on at
    Re: Filter Gallery based on related table

    Hi @hitty08,

    Do you want to Filter off the user whose primary email equals to your text input?

    Could you please show more information about your Dateset 'myTable' and 'User' Table in order to help you better?

     

    I assume that you want to filter off the records in myTable whose id is related to the user that primary email = textbox.text in user table.

    If so, please try the formula:

    Filter(myTable, ID != lookUp(users, ‘primary email’ = textbox.text).ID)

     

     

    Best Regards,

    Kyrie

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on at
    Re: Filter Gallery based on related table

    Hi @hitty08 ,

     

    If the direction is a many-to-one relationship between the Objects table and the Users table, you can try:

     

    Filter(
     'Your objects table',
     'Your user lookup field'.'Primary Email' = User().Email
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 19

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 15 Super User 2025 Season 1

Overall leaderboard

Featured topics