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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,728)