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 / PowerApps Search in ga...
Power Apps
Answered

PowerApps Search in gallery with multiple data sources

(1) ShareShare
ReportReport
Posted on by 19

Hi,

I have a question about using the Search function in the Items property of a gallery that displays information from three data sources (Projects, Customers, Project Managers) in SharePoint Lists. I want to filter the gallery options using a Search Box Input, but I'm unsure how to achieve this with multiple data sources.

For example, the Customer list has two columns [Customer ID, Customer Name], and the Projects list has four columns [Project ID, Project Name, Customer ID, project_status]. However, the Customer ID columns are not LookUp columns. In my gallery, I am displaying Project Name, Customer Name, and PM email in text labels.

Here is the code I am currently using, which only allows me to search in one data source. Is it possible to achieve the functionality I want?

 

 

 

Search(Filter(Projects, project_status = "Execution"), SearchInput1.Text, project_name)

 

 

Thank you!

Categories:
I have the same question (0)
  • Verified answer
    Giraldoj Profile Picture
    872 Moderator on at

    HI @Tatiana21 

     

    For your case my recommendation will be merge all datasoruces into a single collection, and then later apply the filer directly yo the collection.

     

    First, create a collection that merges the necessary data from the Projects, Customers, and Project Managers lists. You can do this on the OnVisible property of the screen:

     

     

    ClearCollect(
     collCombined,
     AddColumns(
     Projects,
     "CustomerName",
     LookUp(Customers, 'Customer ID' = Projects.'Customer ID').'Customer Name',
     "PMEmail",
     LookUp(ProjectManagers, 'Project ID' = Projects.'Project ID').'PM Email'
     )
    );

     


    This collection collCombined now contains columns: Project ID, Project Name, Customer ID, project_status, CustomerName, and PMEmail.

    1. Set Gallery Items Property

    Set the Items property of the gallery to filter and search this combined collection:

     

    Search(
     Filter(collCombined, project_status = "Execution"),
     SearchInput1.Text,
     "Project Name", "CustomerName", "PMEmail"
    )

     


    Let me explain  what we just did

    1. ClearCollect: This function creates a collection collCombined by merging data from the Projects, Customers, and Project Managers lists.

      • AddColumns is used to add CustomerName and PMEmail to the Projects data by looking up the corresponding values in the Customers and Project Managers lists.
    2. Search and Filter:

      • Filter(collCombined, project_status = "Execution"): Filters the combined collection to only include projects with a status of "Execution".
      • Search(..., SearchInput1.Text, "Project Name", "CustomerName", "PMEmail"): Searches the filtered collection based on the text input from SearchInput1 across Project Name, CustomerName, and PMEmail columns.

    If my response resolved your issue, please feel free to mark it as the solution by clicking "Accept as solution." This helps others find the answer more easily. If you found the content helpful in any other way, a "Thumbs Up" would be greatly appreciated. Thank you!

  • Tatiana21 Profile Picture
    19 on at

    Hi, @Giraldoj,

    Thank you so much for your help! It worked for me. Have a good day 🙂 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard