cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brank
Advocate III
Advocate III

Search with the table result of other search

Hello, I was trying to do multiple search in one button, considering that if the search is not found it return all the records, this would be usefull for do a search with multiple parameters. For example in my case I have 2 parameters for search in the table, lets say:

parameter1, parameter2.

I want to do the next:

 

Search(Search('Data source'; String1.Text; Parameter1); String2.Text; Parameter2)

 

In theory I would get all the records that satisfy parameter1 = String1.Text && parameter2 = String2.Text, if doesnt satisfy parameter1 but it does in parameter2 I would get all the records that satisfy parameter2 but in my case I got nothing. It seems I cannot use the result of the first Search as parameter of the second one even though the result is a table with records (that acts the same as a Data source). As an alternative I am doing right now 2^2 = 4 "if" sentences but this isn't scalable at all because if I got 6 parameters I would get 2^6 = 64 "if" sentences, thats why I want to use the search function.

 

Is this a bug or I just don't understand well the functionality of search?

 

If you have any doubts about what I am trying to explain I would answer thankfully.

 

Regards,

12 REPLIES 12
Meneghino
Community Champion
Community Champion

PPS The caching will work only for sources with up to 500 rows.  If you have more than 500 lines then use this:
https://powerusers.microsoft.com/t5/PowerApps-Forum/500-item-limit-in-CDM-entity-search-filter-need-...

 

My solution is towards the end of the post

Hey @Meneghino

You nailed it!

Using "ClearCollect(CachedDataSource; 'Data source')" and then use the search with that collection works with multiple Search functions! This solved my problem but I still don't know why it doesn't work with the datasource in the first search.

 

Thanks for all your help! Smiley Very Happy

Meneghino
Community Champion
Community Champion

It doesn't work because of delegation issues, I imagine.  In any case by caching you can really improve the performance of the searches and lookups so that they are lightning quick even with thousands of rows.

All the best

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,256)