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 / Reverse order of items...
Power Apps
Answered

Reverse order of items in Gallery

(0) ShareShare
ReportReport
Posted on by 136

Powerapp17.PNG

Hi all,

 

I have been asked if there is a way to change the order of items shown in my Gallery. I have attached a picture. ID 1 is at the top meaning that any new item is at the bottom. Is there a way to reverse this so that the newest entries are at the top?

 

Kevin

Categories:
  • eka24 Profile Picture
    20,925 on at

    You need to sort the Gallery. What code do you have on the items property of the Gallery?

    Try:

    Sort(Datasource,ID,Descending)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • kevtun1982 Profile Picture
    136 on at

    @eka24 

    I think that would work but... Where do I put it amongst my current code??

     

    If(
    StatusDropdown.SelectedText.Value="All",
    NewNCR,
    If(
    CategoryDropdown.SelectedText.Value="All",
    Filter(NewNCR, Status.Value = StatusDropdown.SelectedText.Value),
    Filter(NewNCR, Status.Value = StatusDropdown.SelectedText.Value && Category.Value = CategoryDropdown.SelectedText.Value)

  • eka24 Profile Picture
    20,925 on at

    @kevtun1982 

    Use this:


    Sort(
    If(
    StatusDropdown.SelectedText.Value="All",
    NewNCR,
    If(
    CategoryDropdown.SelectedText.Value="All",
    Filter(NewNCR, Status.Value = StatusDropdown.SelectedText.Value),
    Filter(NewNCR, Status.Value = StatusDropdown.SelectedText.Value && Category.Value = CategoryDropdown.SelectedText.Value),ID,Descending)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • kevtun1982 Profile Picture
    136 on at

    Hi @eka24 

    That didnt work. I tried to put in exactly as you suggested. I am not sure what the problem is.

     

    kevtun1982_0-1614943256981.png

     

  • eka24 Profile Picture
    20,925 on at

    Where does the error points to as i cant see the full picture?

    Also do you have ID  as part of the columns in your datasource?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • kevtun1982 Profile Picture
    136 on at

    The ID is automatically generated every time there is a ticket raised. It is in the SP list though.

     

    Below is another image of the errors

     

    Kevin

     

    kevtun1982_1-1614944729383.png

     

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

    @kevtun1982 

    Please consider changing your Formula to the following:

    Sort(
     Filter(NewNCR,
     (StatusDropdown.SelectedText.Value="All" || Status.Value = StatusDropdown.SelectedText.Value) &&
     (CategoryDropdown.SelectedText.Value="All" || Category.Value = CategoryDropdown.SelectedText.Value)
     ),
     ID,
     Descending
    )

    Also, you should consider getting rid of the .SelectedText property on your Dropdowns in the formula as the property has been deprecated and should not be used going forward.

    Example, It should be : StatusDropdown.Selected.someColumn

    The "someColumn" name will be determined by the Items property of your dropdowns.

     

    I hope this is helpful for you.

  • kevtun1982 Profile Picture
    136 on at

    Hi @RandyHayes 

    I am not sure what you mean by that. This is my first app and I have never used any code before. I am learning by using videos and people in the community helping me along with bits of code or editing my code for me to use.

    Sorry

     

    Kevin

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

    @kevtun1982 

    Luckily PowerApps is a no-code platform, so you don't have to look at it as such 😉

    What part don't you understand?  And, did using the formula work for you?

    Be careful with the videos out there...there is a LOT of bad practices shared in them.  They confuse a lot of people.

  • kevtun1982 Profile Picture
    136 on at

    Hi @RandyHayes 

     

    I tried the Formula that you suggested but it just left everything on the screen blank. I have made my app live now and hope to make a few changes as I get the information.

    Kevin

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard