web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter Gallery from an...
Power Apps
Unanswered

Filter Gallery from another table

(0) ShareShare
ReportReport
Posted on by
Hi,

I’m struggling to filter a gallery using another table information. I have:

- Table 1: Country, Entity name and amount
- Table 2: Country, Name, Email

I want to filter a gallery to only show the country for which the user email is in the Table 2. A user email can be listed to multiple countries and there are more than one entry (email) for a country in table 2.

I could made the filter using Lookup but will only work for the users that are listed first in table 2 for each country.

Any thoughts?

Thanks for helping a new PowerApps learner!
Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    You will need a lookUp as you said:
      LookUp(Table2,Email=User().Email,Country) --- Put this in the Default of a Textbox

     

    Then Filter Table1 (On Gallery?) as :
     Filter(Table1,Country=TextBox1.Text)

     

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

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you want to display related country records (whose email is in Table2) from your Table1 in your Gallery?

     

    Based on the needs that you mentioned, I think the Filter function could achieve your needs. Please consider set the Items property of the Gallery to following:

    Filter(
     Table1,
     Country in Filter(Table2, Email = User().Email).Country
    )

    Note: I assume that Country and Email are both Text type column in your Table data source.

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    on at

    Thanks for the reply! I've tred the formula but didn't work. These are my tables:

     

    Table1:

    Country_Table1Entities_Table1Value_Table1
    ArgentinaABC1
    AustraliaABC Australia100
    AustriaAustria ABC5
    ChileChile Inc500

     

    Table2:

    Name_Table2E-Mail_Table2Country_Table2
    Carloscarlos@test.comArgentina
    Pablopablo@test.comArgentina
    Carloscarlos@test.comAustria
    Juanjuan@test.comChile
    Carloscarlos@test.comChile

     

    What I want to do is to filter a BrowseGallery to only show the information in table 1 in which the user ID is listed in table 2 (only showing the countries in which the user email is in table 2).

     

    I've tried with:

     

    Filter(Table1;LookUp(Table2;Country_Table2 = Country_Table1;'E-Mail_Table2') = Lower(User().Email))

     

    Taking into account that my email ID is carlos@test.com; the formula is only returning the below values:

     

    - Argentina

    - Austria

     

    Chile should also appear but as the Lookup only brings the 1st value for Chile it is not matching with my email ID.

     

    Any clues?

  • Community Power Platform Member Profile Picture
    on at

    eka_24 thanks for your reply. I've tried it and didn't work 😞

     

    I've just posted more info about the tables and what I've tried and the result that I'm getting. Maybe that helps to clarify my situation.

     

    Regards

  • v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Based on the formula that you provided, I think there is something wrong with it. This issue is related to the LookUp function in your Filter formula. The LookUp function could only return the first record which matches the specific criteria.

    If you use the LookUp function to find related record in your Table2 based on the Country_Table1 value in your Table1, it could only return the following record for Chile:

    1.JPG

    whose email address is not yours, so the Chile country would not show up in your Gallery.

     

    I have made a test on my side, please take a try with the following workaround:

    Set the Items property of the Gallery to following:

    Filter(
     Table1;
     Country_Table1 in Filter(Table2; 'E-Mail_Table2' = Lower(User().Email)).Country_Table2
    )

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    on at

    Hi,

     

    It doesn't seem to work (I'm attaching screenshot). Bear in mind that:

     

    - Table1 = SOW

    - Table2 = Contracts

     

     

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Based on the screenshot that you mentioned, I think there is something wrong there. You have missed a closed bracket within your Filter formula.

    3.JPG

    So your formula should be like below:

    Filter(
     SOW;
     Country_SOW in Filter(Contacts; 'E-Mail_Contact' = Lower(User().Email)).Country_Contact
    ) // do not miss close brackets here

    then within your Gallery, you need to modify the ThisItem.xxxx formula within the Label control to make it to reference proper column value from your SOW Table.

     

    Best regards,

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard