Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Sorting a list

(1) ShareShare
ReportReport
Posted on by 350

I need to be able to sort a list. The way I did the sort is not the proper way. 

 

I added buttons to the fields I want to be able to sort. But when I scroll across the list the buttons I added don't scroll like the list.  

Here the sort function. 

 

UpdateContext({ctx_sort_column: "crb1a_form_no"}); //use the actual Logical Name of this field
UpdateContext({ctx_sort_order: !ctx_sort_order})
Categories:
  • rroque Profile Picture
    350 on at
    Re: Sorting a list

    I can sort different columns but I don't like how I coded it.  

     

    What I wanted to do is to add buttons on each of the columns I want to sort on. Problem with this is the sort buttons when scrolling the buttons don't scroll along with the rest of the list.  What am I missing?

  • rroque Profile Picture
    350 on at
    Re: Sorting a list

    From my understanding of canvas apps there is no way to add code to the list headers. So what I did instead was to add the sort code to the onselect property of each of the columns I need to sort.  Works perfectly.

     

    Thank you all.

  • rroque Profile Picture
    350 on at
    Re: Sorting a list

    Keith I'm not sure where to add the buttons to.  

  • rroque Profile Picture
    350 on at
    Re: Sorting a list

    Thats exactly the problem. With canvas apps when you add a datasource the fields and headers are pulled in together.  I don't know of a way to remove the headers.  

  • rroque Profile Picture
    350 on at
    Re: Sorting a list

    This is a canvas app and the list in question is a data table.    With model driven apps the sorting of the fields is a function right out of the box.    

  • rzuber Profile Picture
    545 Super User 2025 Season 1 on at
    Re: Sorting a list

    It's a data table? That's different.. I don't know if you can get the button to line up with a column in a data table..

  • rroque Profile Picture
    350 on at
    Re: Sorting a list

    I can't seem to figure out where to place the sort icon

  • rroque Profile Picture
    350 on at
    Re: Sorting a list

     

    Heres my tree view. Can you tell me where I need to add the buttons to?

    rroque_0-1718731935514.png

     

  • KeithAtherton Profile Picture
    3,646 Most Valuable Professional on at
    Re: Sorting a list

    Try selecting the gallery then insert a new button, it should show as nested under the gallery.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Connect with me online.

  • rroque Profile Picture
    350 on at
    Re: Sorting a list

    I'm not getting how to add the buttons to the gallery. 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard