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

Highlighted
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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,086)