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 / Help with sorting func...
Power Apps
Answered

Help with sorting function

(0) ShareShare
ReportReport
Posted on by 3

The sort button is working but I would like the information to be displayed with the most recent entries first when the user first loads the app. As of now when the user first accesses the app it show's the oldest entries first until you sort. Below is a picture with my code:

mhgottsc_0-1644859366924.png

Thanks!

 

Categories:
I have the same question (0)
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @mhgottsc your formular should more look like this

     

    If(!IsBlank(varDateSort),SortByColumns(........),SortByColumns(......))

     

    So the else part of your if is wrong. If you can't get it to work please paste your formular here.

     

    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.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @mhgottsc 

    Change your formula to the following:

    SortByColumns('Sales Point Tracker Team', 
     "Date", 
     If(Coalesce(varDateSort, true),
     Descending,
     Ascending
     )
    )

     

    The Coalesce function will provide a way to "default" a blank variable to whatever value you want - in this case, true.

     

    I hope this is helpful for 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

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard