cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marcro97
Level: Powered On

Custom order of items in a gallery

Hi everyone,
I'm struggling with this issue: i want to order my items in a customized way, not ascending or descending, but just in the order that I need... for example, I have to order the phases of a production process, and these (obviously) aren't in alphabetical order...
It is possible? How it can be done?

Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Custom order of items in a gallery

Hi @marcro97,

You can use the addcolumn function in the item property of the gallery to add numeric values to the items.

For example,

Your items property could be (assuming Production is the datasource)

SortByColumns(AddColumns( Production, "PhaseSortOrder", If(Phase = "PhaseA" , 1, If(Phase = "PhaseB", 2), If(Phase = "Phase3", 3))), "PhaseSortOrder", Ascending)

Please let me know if this helps and mark this reply as the solution. Thanks!

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Custom order of items in a gallery

Hi @marcro97,

You can use the addcolumn function in the item property of the gallery to add numeric values to the items.

For example,

Your items property could be (assuming Production is the datasource)

SortByColumns(AddColumns( Production, "PhaseSortOrder", If(Phase = "PhaseA" , 1, If(Phase = "PhaseB", 2), If(Phase = "Phase3", 3))), "PhaseSortOrder", Ascending)

Please let me know if this helps and mark this reply as the solution. Thanks!

View solution in original post

marcro97
Level: Powered On

Re: Custom order of items in a gallery

It works perfectly! On your advise, I preferred to add a column in my Sharepoint database which describes the priority of the phase and to patch it as you said.

Thank you a lot!

Super User
Super User

Re: Custom order of items in a gallery

Perfect, that makes sense! Glad I could help!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,793)