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)
Solved! Go to Solution.
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
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
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
User | Count |
---|---|
161 | |
86 | |
68 | |
63 | |
62 |
User | Count |
---|---|
212 | |
146 | |
93 | |
81 | |
68 |