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 Apps
Unanswered

Sort Function

(0) ShareShare
ReportReport
Posted on by 9

Hi,

 

I have a power app for a SharePoint task tracker. The sort function (Up down arrow) on the app sorts by alphabetically. I want it to sort if the progress is "in progress" or "complete"

 

What code do I need to change? I need the progress value to be the sorting item. 

 

SortByColumns(Filter([@'Work progress tracker'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi  @andydwall ,

     

    You can add an extra condition to the filter function:

     

    SortByColumns(
     Filter(
     [@'Work progress tracker'],
     StartsWith(
     Title,
     TextSearchBox1.Text
     )
     ),
     Progress.Value = "in progress" || Progress.Value = "complete"
     "Title",
     If(
     SortDescending1,
     Descending,
     Ascending
     )
    )
  • andydwall Profile Picture
    9 on at

    Still getting errors. Everything disappears when this code is put in. 

  • andydwall Profile Picture
    9 on at

    andydwall_0-1653520490237.png

    I need the sort function in the app to sort by in progress or completed.

  • andydwall Profile Picture
    9 on at

    Please see other replys.

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @andydwall ,

     

    I assumed the status column was a choice type, but if it's not, indeed that will cause issues. What is the error you are getting?

  • andydwall Profile Picture
    9 on at

    Hi,

     

    See the photos below. Pulling from the list and app is to track tasks. I just need the sort function to sort based on Progress value which is "body" and not alphabetical order of the title. I added a few more items to the code cause progress has possibility of being other options. 

     

    andydwall_0-1653586955758.png

    SortByColumns(

        Filter(

            [@'Work progress tracker'],

            StartsWith(

                Title,

                TextSearchBox1.Text

            )

        ),

        Body = "In Progress" || Body = "Completed" || Body = "Blocked" || Body = "Not Started" || Body = "Behind"

        "Title",

        If(

            SortDescending1,

            Descending,

            Ascending

        )

    )

     

    this is code under the sort function tab.

     

    If(SortDescending1, "Sort list in reverse alphabetical order", "Sort list in alphabetical order")

     

    andydwall_1-1653587153158.png

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard