web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : j6tmzYXc3lYNV6N7sqlm7D
Power Automate - General Discussion
Unanswered

Sort Gallery by multiple choice columns

Like (0) ShareShare
ReportReport
Posted on 3 Sep 2021 15:17:30 by 578

I'm working on a nested gallery using SharePoint data. The data is sorted by Regional Office and it is working fine. The issue is that I need to sort by a second column (State). Both the Regional Office and the State are choice columns. 

 

Sorting / Grouping by Regional Office works fine:

SortByColumns(
 GroupBy(
 AddColumns(
 Filter(
 'Catalog',
 Year = "2021"
 ),
 "RO",
 'Regional Office'.Value
 ),
 "RO",
 "GrouppedROs"
 ),
 "RO",
 Ascending
)

 

When I try to add a second sorting parameter (State), it fails:

 

SortByColumns(
 GroupBy(
 AddColumns(
 Filter(
 'Catalog',
 Year = "2021"
 ),
 "RO",
 'Regional Office'.Value,
 "TheState",
 'State'.Value
 ),
 "RO",
 "GrouppedROs"
 ),
 "RO",
 Ascending,
 "TheState",
 Ascending
)

 

I get an error that says in part that "TheState" column doesn't exist:

 

Annotation 2021-09-03 111216.jpg

 

I have the feeling that all the issue is that I'm creating or placing TheState column in the wrong place. Any idea what am I doing wrong?

Thanks in advance.

 

Categories:
I have the same question (0)
  • emfuentes27 Profile Picture
    578 on 07 Sep 2021 at 15:29:57
    Re: Sort Gallery by multiple choice columns

    Thanks for the suggestion @Ashwin7104, but as far as I know I have to use AddColumns also, otherwise how would I define "RO" and the 'TheState". I use AddColumns to define Regional Office.value, as "RO", and "TheState" from State.value?

  • Ashwin7104 Profile Picture
    671 on 03 Sep 2021 at 18:15:31
    Re: Sort Gallery by multiple choice columns

    Hey @emfuentes27 ,

     

    Try the below code - I have used ShowColumns instead of Add Columns to ensure TheState exists.

    GroupBy(
    SortByColumns(
     ShowColumns(
     Filter(
     'Catalog',
     Year = "2021"
     ),
     "RO",
     "TheState"
     ),
     "RO",
     Ascending,
     "TheState",
     Ascending
    ),
     "RO",
     "GrouppedROs"
    		)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started
Loading complete