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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sort a gallery based o...
Power Apps
Answered

Sort a gallery based on a date condition in ascending order

(0) ShareShare
ReportReport
Posted on by 88

Hi,
I would like to ask for your help. What and where should I set in order to I can sort a gallery with a pre-defined date condition. I need it in ascending order. I use sharepoint list in the background that contains Final_Deadline field based on that I would sort the gallery.

Thank you for your help in advance,

Kriszta

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @Kriszta - what do you mean by "pre-defined" date condition? Do you you simply want to sort on the "Final_Deadline" column?

  • Kriszta Profile Picture
    88 on at

    Hi Amik, I need a simple solution for a simple ascending order but it also would be good to know how I can define that if I need final_deadline between today-14 days and today+14 days in the gallery for example. Is it possible to pre-define it somehow?

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @Kriszta - basic syntax to sort:

     

    Sort(
     'Your List',
     Final_Deadline,
     SortOrder.Ascending
    )
    

     

    By "pre-define", I think you mean Filter:

     

    Sort(
     Filter(
     'Your List',
     Final_Deadline>= DateAdd(
     Today(),
     -14,
     TimeUnit.Days
     ) && Final_Deadline <= DateAdd(
     Today(),
     14,
     TimeUnit.Days
     )
     ),
     Final_Deadline,
     SortOrder.Ascending
    )
    
  • Kriszta Profile Picture
    88 on at

    It works. Thank you 🙂

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard