Hello everyone,
I'm having some trouble getting the right formula to Sort AND Filter a Gallery in PowerApps.
Here is an example of a Filter Gallery I have created:
Here is an example of a Sort Gallery I have created:
The name of the SharePoint list is 'Overseas Travel Log'. I am trying to create a formula that merges both the Sort and Filter together. They work separately, but not together.
What I want is a formula that filters by user (first formula) and shows the newest (creation) date first (second formula). The first image is what I want, however the dates are shown oldest - newest. I'd essentially like this reversed so it shows the newest result first, as shown in the second image.
I hope this is enough context 🙂
I did look online, which suggested I do this: 'Sort(Filter(DataSource, FilterCondition), SortColumn, SortOrder)', but this hasn't worked:
Thanks all for your help 🙂
Katie.
Fantastic, glad it helped 😄
You're a legend!!! This worked 🙂
Thank you so much for your help. I really appreciate it.
Thank you!!!
Hi @KatieGrantBAS,
Yeah, looking at the code you've provided it doesn't look quite right, as it doesn't look like you've closed the Filter before entering the Sort commands. Try this instead. I've bolded the brackets related to the Filter function.
SortByColumns(Filter('Overseas Travel Log', 'Person Travelling Email' = User().Email, 'Date Form Created' <= Today()), 'ID', SortOrder.Descending)
Hi there,
Thank you for your speedy response! I tried changing Sort to SortByColumns, however it doesn't appear to have worked 😞 I wonder if there's something really small and niggly i'm doing wrong here.
Hi @KatieGrantBAS,
Your code looks almost correct, but instead of Sort you want SortByColumns
Try SortByColumn(Filter(DataSource, FilterCondition), SortColumn, SortOrder)
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional