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 / Sorting Gallery Items
Power Apps
Unanswered

Sorting Gallery Items

(0) ShareShare
ReportReport
Posted on by

Hi

 

I am creating a Gantt chart which is fed form multiple lines of a SP list. Is there a way to sort the items in the gallery so that all lines in the list which have the same first column name are shown underneath each other? For example, let's say I have a line with the job column as "Job 1" and then I have another line with "Job 2" and then another with "Job 1" again - can I sort them so that the gallery shows both lines with "Job 1" first and then "Job 2" is then shown underneath?

 

Many thanks. 

Categories:
I have the same question (0)
  • martijnA Profile Picture
    62 on at

    in your items property of the gallery you can just "Sort"  like this:

     

    Sort(myItems,Job,Ascending)

     

    where "myItems" should be replaced with your SP list name & "Job" with the SP column name

     

    Did this answer help you in any way? Consider to "Accept as Solution" and give a "Thumbs Up"

  • jed76 Profile Picture
    on at

    Many thanks!

    Is there a way to do with a collection? I am also applying a filter to the Gallery which filters the items shown based on the same column and whether they are selected. So basically, I want to be able to select whether the main job is shown at all and then if selected, sort all of the lines together by the job column?

  • jed76 Profile Picture
    on at

    This is what I currently have in the ITEMS of the Gallery, where colTasks is the collection and ProjectID is the job identifier.galProjectList is another gallery which lists all of the jobs available to view and chkPLIsSelected is the button to select the job. 

     

    Filter(colTasks,ProjectId in Filter (galProjectList.AllItems,chkPLIsSelected.Value - true).Result

     

    So if more than one job is selected, I also then need to sort what is shown by the ProjectID. 

     

  • martijnA Profile Picture
    62 on at

    Evaluation works from the inside out. So yes, you can apply a sort just as easily

     

    Filter(colTasks,ProjectId in Filter (galProjectList.AllItems,chkPLIsSelected.Value - true).Result

     

    would become

     

    Sort(Filter(colTasks,ProjectId in Filter (galProjectList.AllItems,chkPLIsSelected.Value - true).Result,COLUMNTOSORT,Ascending/Descending)

  • jed76 Profile Picture
    on at

    Brilliant - I'll give it ago!

     

    Thank you. 

  • jed76 Profile Picture
    on at

    Thank you so much - I just needed to add a bracket after "RESULT". Worked a treat. 

     

    Would I also be able to incorporate a second check box gallery so that I could just select all of the same lines. For example, say two jobs each have a line called "task 1" and "task 2", I'd like to be able to choose to show all "task 1s" only. 

  • jed76 Profile Picture
    on at

    I think I just need to put another filter inside the existing filter?

  • martijnA Profile Picture
    62 on at

    that's correct, just as long as you remember they work from the inside out you can create as many filters as you like. Don't overkill it though, it makes things slower

     

    Did this answer help you in any way? Consider to "Accept as Solution" and give a "Thumbs Up"

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard