cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Kudo Kingpin
Kudo Kingpin

Sorting a Gallery with headers

Hi there,

 

Quick question?

 

I have my share point list table like a purchase order style, so I have CustomerID, CustomerName, ItemID, etc.

 

In my form I have a dropdown field to retrieve my customer's name

SortByColumns(Customers,"Title",Ascending)

 

A text field to retrieve my customer ID:

LookUp(Customers,Title=ComboBoxSelectCustomer.Selected.Title,ID)

 

and a gallery for the result.

 

Now I would like to see the items in my gallery sorted by any specific field in my table orders, but I don't want to see repeating titles like this:

 

CustomerID   CustomerName ItemID  ItemDescription

10                 ABC                     8          Laptop

10                 ABC                     14        Keyboard

10                 ABC                     17       Mouse

 

I would like my gallery sorted like this

 

Customer : 10         ABC

 

ItemID         ItemDescription

8

14

17

 

Customer : 11      DEF

20

25

36

 

etc.

 

Is this possible?

 

Thank you in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @sajarac ,

Do you want to convert table1 to table2 and table3?

table1:

CustomerID   CustomerName ItemID  ItemDescription

10                 ABC                     8          Laptop

10                 ABC                     14        Keyboard

10                 ABC                     17       Mouse

 

table2:

Customer : 10         ABC

table3:

ItemID         ItemDescription

8

14

17

 

If so, I suggest you try GroupBy function.

If you want to see table2:

ShowColumns(GroupBy(table1,"CustomerID","CustomerName",newgroup),"CustomerID","CustomerName")

If you want to see table3:

Frist(GroupBy(table1,"CustomerID","CustomerName",newgroup)).newgroup

Here's a doc about GroupBy function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby

 

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @sajarac ,

Do you want to convert table1 to table2 and table3?

table1:

CustomerID   CustomerName ItemID  ItemDescription

10                 ABC                     8          Laptop

10                 ABC                     14        Keyboard

10                 ABC                     17       Mouse

 

table2:

Customer : 10         ABC

table3:

ItemID         ItemDescription

8

14

17

 

If so, I suggest you try GroupBy function.

If you want to see table2:

ShowColumns(GroupBy(table1,"CustomerID","CustomerName",newgroup),"CustomerID","CustomerName")

If you want to see table3:

Frist(GroupBy(table1,"CustomerID","CustomerName",newgroup)).newgroup

Here's a doc about GroupBy function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby

 

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (67,253)