cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rodieremix
Level: Powered On

BrowseGallery Search/Filter always navigates to first item first

Hi,

 

I have a weird issue that I'm hoping to get some assistance with. I have a gallery with a Filter function that works just as I want it to and is displaying the correct items. With just the filter options, if I select an item, it navigates to that item every time. However, if I add a search in the function, the items still display properly but they always navigate to the first item displayed the first time. Then when I go back and navigate to the item, it works that time. I've tried a number of different formulas and they all do the same thing. Here are the formulas I have been working with. Any assistance is appreciated.

 

Works correctly (no search option):

 

SortByColumns(Filter('Activation Requests', If(!IsBlank(PRSEmailVar),PRS_x0020_Email = PRSEmailVar,true) && If(!IsBlank(StatusVar),Setup_x0020_Status.Value = StatusVar,true) && If(!IsBlank(SuperVar),PRS_x0020_Supervisor.Email = User().Email,true)),SortVar, AscDesVar)

 

Works incorrectly (includes search option):

 

Version 1:

 

If(IsBlank(TextSearchBox1),SortByColumns(Filter('Activation Requests', If(!IsBlank(PRSEmailVar),PRS_x0020_Email = PRSEmailVar,true) && If(!IsBlank(StatusVar),Setup_x0020_Status.Value = StatusVar,true) && If(!IsBlank(SuperVar),PRS_x0020_Supervisor.Email = User().Email,true)),SortVar, AscDesVar),SortByColumns(Search('Activation Requests',TextSearchBox1.Text,"Client_x0020_Name_x0028_s_x0029_","Client_x0020_Number_x0028_s_x002"),SortVar, AscDesVar))

 

Version 2:

 

SortByColumns(Filter('Activation Requests', If(!IsBlank(PRSEmailVar) && IsBlank(TextSearchBox1),PRS_x0020_Email = PRSEmailVar,true) && If(!IsBlank(StatusVar) && IsBlank(TextSearchBox1),Setup_x0020_Status.Value = StatusVar,true) && If(!IsBlank(SuperVar) && IsBlank(TextSearchBox1),PRS_x0020_Supervisor.Email = User().Email,true) && If(!IsBlank(TextSearchBox1),TextSearchBox1.Text in Client_x0020_Number_x0028_s_x002 Or TextSearchBox1.Text in Client_x0020_Name_x0028_s_x0029_,true)),SortVar, AscDesVar)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
rodieremix
Level: Powered On

Re: BrowseGallery Search/Filter always navigates to first item first

2 REPLIES 2
Community Support Team
Community Support Team

Re: BrowseGallery Search/Filter always navigates to first item first

Hi @rodieremix,

 

I just looked into your formula, I think the Search function part is correct as long as the column names are correct. But I have question about SortByColumns part. 

 

There are 2 kinds of Syntax for SortByColumns function, which one are you using? And what is SortVar and AscDesVar stand for?

SortByColumns( Table, ColumnName1 [, SortOrder1, ColumnName2, SortOrder2, ... ] )
SortByColumns( Table, ColumnName, SortOrderTable )

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rodieremix
Level: Powered On

Re: BrowseGallery Search/Filter always navigates to first item first

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 325 members 5,902 guests
Please welcome our newest community members: