cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marcro97
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
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
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

Highlighted
marcro97
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!

Super User
Super User

Re: Custom order of items in a gallery

Perfect, that makes sense! Glad I could help!

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

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