cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

Frequent Visitor

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!

Highlighted
Super User
Super User

Re: Custom order of items in a gallery

Perfect, that makes sense! Glad I could help!

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (6,163)