cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Sorting a Gallery - By Subtitle?

Hi everyone

 

I have a gallery built in my app that's based on a collection.

The Item code that I have on the gallery is the following: SortByColumns(GroupBy(SelectedSST,"Help_Reasons","Help_Group"),"Help_Reasons",Ascending)

 

So I've grouped all the responses based on the Title of the response. 

I need them grouped together based on the response, but I'm hoping I can sort by the Subtitle label that I have highlighted in blue. The Text coding that I have on the subtitle is just a count function: CountIf(SelectedSST,Help_Reasons=Title9_1.Text)

 

Anyone know how I can Sort by my Subtitle but still keep the gallery grouped by it's responses? 

 

GalleryPicture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Hi @smartin 

 

On your Gallery.Items property, you can add the following formula:

SortByColumns(
    AddColumns(
        GroupBy(SelectedSST,"Help_Reasons","Help_Group"),
        "Total",
        CountRows(Help_Group)
    ),
    "Total",
    Descending
)

 

and then change your Subtitle label to ThisItem.Total.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

 

Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

1 REPLY 1
Super User
Super User

Hi @smartin 

 

On your Gallery.Items property, you can add the following formula:

SortByColumns(
    AddColumns(
        GroupBy(SelectedSST,"Help_Reasons","Help_Group"),
        "Total",
        CountRows(Help_Group)
    ),
    "Total",
    Descending
)

 

and then change your Subtitle label to ThisItem.Total.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

 

Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (93,870)