Hi, could anyone help with how to format the below so I don’t get errors? I am trying to do the following to my gallery:
Search bar filter
Combobox filter x 2
Filter what can be seen so admin can see all but users can only see their own department.
Sort the gallery to the newest items are at the top.
Below is copied from the items part of my gallery:
Sort(
SortOrder.Descending)
Thanks
Hi @Ajam88 ,
Try this
With(
{
wField:
Switch(
locSortColumn,
"Collection date",
"Collectiondate",
"Return date",
"Returndate"
),
wOrder:
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
},
SortByColumns(
Filter(
'BC Loan Archive',
StartsWith(
Title,
BdeRefSearch.Text
)
),
wField,
wOrder
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi @WarrenBelz, I seem to have real trouble with the filtering in gallery’s. You have helped me a few times with this so hoping you might be able to again. I have got a the following which throws no errors but it’s not having the desired impact, the final Filter piece is supposed to filter the text column when I type in the search box. But it’s not working. I am assuming it’s something to do with the earlier switch function but I can’t seem to get it sorted. Any help would be greatly appreciated!
Switch(locSortColumn, "Collection date", Sort('BC Loan Archive', Collectiondate, If(locSortAscending, SortOrder.Ascending, SortOrder.Descending)), "Return date", Sort('BC Loan Archive', Returndate, If(locSortAscending, SortOrder.Ascending, SortOrder.Descending)), Filter('BC Loan Archive',(StartsWith(Title, BdeRefSearch.Text))))
Hi @Ajam88 ,
You are missing a bracket for a start
Sort(
Filter(
'0301 HQSW G6 BC App Reg',
varReset &&
(
StartsWith(
Title,
SearchbarOPBC_1.Text
) &&
(
Len(ComboBoxSystem2_1.Selected.Value) = 0 ||
System.Value = ComboBoxSystem2_1.Selected.Value
) &&
(
Len(ComboBoxStatus2_1.Selected.Value) = 0 ||
Status.Value = ComboBoxStatus2_1.Selected.Value
) &&
(
VarUserAdmin= true ||
Unit.Value = VarUserUnit.Value
)
)
),
Modified,
SortOrder.Descending
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps