Skip to main content
Community site session details

Community site session details

Session Id : FD0Nm0QLY0p4Yy1uXV9dSr
Power Apps - Building Power Apps
Answered

Filter a Gallery based on Text Label Value that is being Look-Up from another Data Source

Like (0) ShareShare
ReportReport
Posted on 22 Jun 2023 06:05:09 by 8

Hi! I need help regading the below scenario

1. I have a sharepoint list as a data source (SPList1)

2. I have a gallery (Gallery1) in powerapps that should display the items from SPList1

3. Inside the gallery i have a textbox (txtStatus) whick looks-up to a different data source (Excel1) - an excel file in onedrive

 

I want to filter Gallery1 using a dropdown control (dd1) which has a list of the statuses. How do I filter the gallery which will show only the items matching txtStatus with the selection in dd1?

 

Thank you

Categories:
  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 23 Jun 2023 at 08:45:01
    Re: Filter a Gallery based on Text Label Value that is being Look-Up from another Data Source

    I am glad you have made it work but you should not have to use in.

     

    Is there not a one-to-one link/unique id which relates a row in your Excel file to a row in SPList1?

  • JNVCANDO Profile Picture
    8 on 23 Jun 2023 at 08:16:15
    Re: Filter a Gallery based on Text Label Value that is being Look-Up from another Data Source

    @Amik ,

     

    Finally made it work.

     

    Replaced the "=" in the below formula to "in"

    From:

    'Unique ID' = 'Related Unique ID in Excel'

     

    To:

    'Unique ID' in 'Related Unique ID in Excel'

     

    Thank you very much for your help!

  • Verified answer
    Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 23 Jun 2023 at 01:43:06
    Re: Filter a Gallery based on Text Label Value that is being Look-Up from another Data Source

    @JNVCANDO told you it was a terrible data source. Try refreshing the Excel file from the Data tab.

     

    Also, just noticed in my expression that "Value" is not needed in _Status.Value.

     

    Updated below:

     

     

    Filter(
     AddColumns(
     SPList1,
     "_Status",
     LookUp(
     'Your Excel Data',
     'Unique ID' = 'Related Unique ID in Excel'
     ).Status
     ),
     _Status = dd1.SelectedText.Value
    )

     

     

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

     

    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.

  • JNVCANDO Profile Picture
    8 on 23 Jun 2023 at 01:18:12
    Re: Filter a Gallery based on Text Label Value that is being Look-Up from another Data Source

    Hi  @Amik ,

    I am getting this prompt when referencing the added column using a text label in the gallery

    JNVCANDO_0-1687482989556.png

     

    I also am not allowed to use _Status.Value when trying to filter the gallery

    Thanks again

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 23 Jun 2023 at 00:21:59
    Re: Filter a Gallery based on Text Label Value that is being Look-Up from another Data Source

    Hi @JNVCANDO , 

     

    I would avoid applying a Lookup function to a Label in a Gallery if you can help it.

     

    In the Items property of the Gallery, I assume you just have "SPList1". This is a TableYou can use the AddColumns function to include additional columns into that Table. In your scenario, we can use a Lookup function to bring in the Status column from your other data source and apply it to each record in the Table.

     

    Apply the below for example into the Items property of your Gallery. You will notice that the custom column we created ("_Status") can now be referenced in your Gallery via ThisItem_Status.

     

     

     

     AddColumns(
     SPList1,
     "_Status",
     LookUp(
     'Your Excel Data',
     'Unique ID' = 'Related Unique ID in Excel'
     ).Status
     )

     

     

     

    To take this further, we can apply a Filter to the above table based on your Dropdown control. Replace the above expression with the below expression:

     

     

     

    Filter(
     AddColumns(
     SPList1,
     "_Status",
     LookUp(
     'Your Excel Data',
     'Unique ID' = 'Related Unique ID in Excel'
     ).Status
     ),
     _Status.Value = dd1.SelectedText.Value
    )

     

     

     

     

    On a separate note, Excel is a terrible data source. Please avoid using it if you can and instead use SharePoint (given you are using it already).

     

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

     

    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.

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 our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete