cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alex-W
Helper III
Helper III

Search Multiple Data Sources

Is it possible to do a search across multiple data sources connected to an app?

 

My organization has many SharePoint Online sites and each of these sites has a contacts lists for the team the site is assigned to.  We have one app that is connected to all the contact lists and it enables users to click on links to view the various lists in a gallery.  This works great, but I have a request from a user to add a search to the app that allows him to search for a contact if he does not know what team the person he is looking for is on.  Is this possible?  

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Alex-W 

Yes, this is certainly possible in PowerApps.

 

Example:

Ungroup(
    Table(
        {Items: Search(list1, text, "fields")},
        {Items: Search(list2, text, "fields")},
        {Items: Search(list3, text, "fields")}
    ),
    "Items"
)

The above will provide searches across multiple sources assuming the schemas are somewhat common.

 

You could use Filter instead of search, or pretty much whatever you need.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@Alex-W 

Yes, this is certainly possible in PowerApps.

 

Example:

Ungroup(
    Table(
        {Items: Search(list1, text, "fields")},
        {Items: Search(list2, text, "fields")},
        {Items: Search(list3, text, "fields")}
    ),
    "Items"
)

The above will provide searches across multiple sources assuming the schemas are somewhat common.

 

You could use Filter instead of search, or pretty much whatever you need.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Alex-W
Helper III
Helper III

@RandyHayes 

 

Thank you for the quick response!  I know a thing or two about Power Apps but I am far from being an expert.  Can you explain how to use that ungroup function?  Where do I put it?

RandyHayes
Super User
Super User

@Alex-W 

That would be in your Items property for your Gallery.  Assuming that you are displaying your search results in a Gallery.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Alex-W
Helper III
Helper III

@RandyHayes 

 

I got it to work!  I just need to fix the formatting for the gallery.  Thanks for the help on this!!

 

For anyone else that has a similar issue and not that great at developing apps, in addition needing a gallery for this, you will need a text input field.  This is where users will type in whatever it is they are searching for.  The name of this field will come before the word "text" in Randy's ungroup function that he provided earlier.  So for example, I named my text input field, "TextSearch1".  To make this work in Randy's function, replace "text" with TextSearch1.Text.

 

List and fields should be easy to figure out, but this is name of list you want to include in the search and field is the name of the list column you want the search to look at.  

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,615)