cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @Anonymous,

 

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.
Anonymous
Not applicable

Hi @v-monli-msft,

 

I was able to sort the issue, the thread below helped me. Thanks!

 

https://powerusers.microsoft.com/t5/General-Discussion/Filter-gallery-items/td-p/45199

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.

Users online (1,734)