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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,385)