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 a Gallery based...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on 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,689 Super User 2024 Season 1 on at

    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 Table. You 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.

  • JNVCANDO Profile Picture
    8 on at

    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

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @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 at

    @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!

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    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?

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

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard