web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How Best to sort and f...
Power Apps
Unanswered

How Best to sort and filter within a Gallery.

(0) ShareShare
ReportReport
Posted on by 47

In PowerApps, I am creating a Gallery connected to a list for employees to add vacation/leave time, this list also includes holidays.  

In the gallery, I am trying to filter by the current logged in user and sort by the date of the vacation/leave and built-in holiday.

 

This code will bring me the Filter part "(Filter('VacationList','Creator Email'=User().Email)" but I don't get any response from the holiday column.

SortByColumns(Filter('VacationList','Creator Email'=User().Email),"Holiday", Ascending)

 

Please let me know what I need to change in the code so I can get the list of holidays to show.

Any help would be great.

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Darren11 

    To troubleshoot do two things

    • Put SortByColumns('VacationList', "Holiday", Ascending) as the items property of your gallery and see if the holiday column populates.
    • Put a label in the gallery with its text property:  ThisItem.'Creator Email'  to see if that field gets displayed or errors out. 
  • Darren11 Profile Picture
    47 on at

     Drrickryp,
    Thank you for responding. I tried what you suggested and Yes, it is returning all the correct data for the, SortByColumns('VacationList', "Holiday", Ascending). I do already have a label with ThisItem.'Creator Email' and it is working as it should.

     

    Allow me to explain a bit deeper into my attempt here.

    Overall, as a user enters a vacation/leave request through a form, they pick from a dropdown and enter a start and end date. The result displays on the Work Schedule list. No issues there. 
    When any user views the Work Schedule, they should only see their entry and not everyone else's. Blended in with the list of entries are the standard holiday dates. These should appear for everyone.  

    I am able to get the list of Holidays to appear and I can get the Vacation/Leave list to appear, but it includes all users in every view. As a result, I am not able to get the vacation list of just one user's choices along with the Holiday list.  Below is a sample image of what it might look like. 

    General idea of list results.General idea of list results.

     

     

     

     

     

     

     

    A bit of an explanation on the code I am using.

    Leave-Holiday List Sample-Code.pngBlue is the filter that pulls the vacation/leave for each logged in user. Green is, what I thought would pull all the holidays and place them in ascending order. 

    I have tried numerous variations of this line, but I am not able to get both to display. I thought perhaps I should use an "And" or "&&" to get the holidays, but that didn't work either.
    Sorry for the long entry, I'm just trying to be clear about the issue. 

     

    Thanks.

  • Darren11 Profile Picture
    47 on at

    Being new to Power Apps, I knew this would be a challenge. I am still trying to resolve this issue after several days of trying to resolve this code. I feel I am very close, but it just isn't coming out properly.

    I can get all the data to display, but I need it to filter by the logged-on user and be in ascending order.

     

    Any suggestions, anyone?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard