cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jonny_anything
Frequent Visitor

Searching across multiple tabs

Hello,

 

I have set up a very simple 'classified ads' style Powerapp. Using the existing 'Asset Checkout' canvas app as a base.

 

Basically, I have a search box and when I search something it is only showing me results for the selected tab. In the attached screenshot for example, my search would only return items in the 'For sale' tab because that is what is currently selected.

 

Is there any way to search across all three of the tabs (for sale, for free, wanted) in a single search?

 

I would be very grateful for any help on this!

 

Thanks,

 

Jonny

 

6 REPLIES 6
RezaDorrani
Dual Super User
Dual Super User

Hi @jonny_anything 

 

Remve the CategoryID part of the filter

 

Remove Categoryid = CategoriesGallery.Selected.CategoryId

 

So Filter part of forumla becomes

Filter(Products,SearchBoxText.Text in ProductName)

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Hi @RezaDorrani 

 

Thank you for the prompt reply - much appreciated!

 

I made that change, the issue I have is that all of my items now appear in the 'For sale', 'For free' and 'Wanted' tabs (when they are selected) before I hit search I search i.e. they are no longer categorised.

 

The 'For Sale', 'For Free' and 'Wanted' titles are clickable so I'd like them to just show the products in those categories when clicked and the search results to show any relevant products from all 3 tabs. If that makes sense?

 

Thanks,

 

Jonny

v-xida-msft
Community Support
Community Support

Hi @jonny_anything ,

Could you please share a bit more about your scenario?

Do you want to search your Gallery items across all three of tabs (categories) before pressing the category tab in your app?

 

I have made a test on my side, please take a try with the following workaround:5.JPG

 

4.JPG

Please set the OnSelect property of the Group1 under the CategoriesGallery to following:

UpdateContext({SelectedCategory: ThisItem.CategoryName, search_reset:true})

Set the Items property of the ProductsGallery to following:

SortByColumns(
Filter(
AddColumns(ProductsCol, "CategoryName", LookUp(Categories, CategoryId=ProductsCol[@CategoryId], CategoryName)),
SearchBoxText.Text in ProductName,
If(!IsBlank(SelectedCategory), CategoryName = CategoriesGallery.Selected.CategoryName, true)
),
If(category = "Reviews", "Comments", "Available"),
If(category = "Reviews", Descending, Ascending)
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

Thank you for your reply.

 

"Do you want to search your Gallery items across all three of tabs (categories) before pressing the category tab in your app?"

 

That is correct yes, I want to be able to search across all 3 categories but if i select one of the tabs i only see the products that are in that category.

 

I tried to implement your solution, the OnSelect worked fine, however I am getting some errors for the ProductGallery - do you have any ideas why that might be?

 

Thank you,

 

Jonny 

 

 

 

Hi @jonny_anything ,

Could you please share a bit more about the ProductsCol data source in your app? Is it a Excel table or a Collection?

 

Based on the error message screenshot that you mentioned, I think there is something wrong with the ProductsCol data source.

 

Please make sure that there is already a ProductsCol table data source added within your app. 

 

I have made a test on my side, and don't have the issue that you mentioned. Please make sure you have specified proper table data source within your Filter formula. If the data source you used in your app called 'Products', please modify your formula as below:

Set the Items property of the ProductsGallery to following:

SortByColumns(
Filter(
AddColumns(Products, "CategoryName", LookUp(Categories, CategoryId=ProductsCol[@CategoryId], CategoryName)),
SearchBoxText.Text in ProductName,
If(!IsBlank(SelectedCategory), CategoryName = CategoriesGallery.Selected.CategoryName, true)
),
If(category = "Reviews", "Comments", "Available"),
If(category = "Reviews", Descending, Ascending)
)

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

Thanks for the reply. 

 

I have updated 'ProductsCol' to be 'Products' and amended the items propery of the ProductsGallery. The error is no longer showing, which is great. I am still not able to search between multiple tabs though - the search bar is still only searching the selected tab.

 

To give you some more information about the app. It is set up to submit to an Excel table stored on OneDrive. Please see some screengrabs attached showing the Excel. Do you have any idea what I am doing wrong?

 

Thanks,

 

Jonny

 

 

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 (2,938)