cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
livingstonep
Kudo Commander
Kudo Commander

Sort a gallery by two columns from a filtered sharepoint list

We have a sharepoint list as the source called 'Create Expense Claim' for our gallery.

 

The items are filtered on the Status column, having values of either Pending or AP Approved.

 

I want to sort by status descending, and by item ID descending

 

But I can't get it to compile in the designer.

 

here is my code:

SortByColumns(
Filter(
'Create Expense Claim',
Status.Value = "Pending" || Status.Value = "AP Approved"
),
"Status",
Descending,
"ID",
Descending
)

 

If I use the Sort on one column, it works fine:

Sort(
Filter(
'Create Expense Claim',
Status.Value = "Pending" || Status.Value = "AP Approved"
),
"Status",
Descending,
)



 

so how can I sort my filtered list on both columns?

1 REPLY 1
mdevaney
Super User
Super User

@livingstonep 

I don't see any issues with your code... what do you mean by "it wont compile in the designer?"  Are you receiving an error message or red underline?   Please share a screenshot with your full code and error message.

 

SortByColumns(
    Filter(
        'Create Expense Claim',
        Status.Value = "Pending" || Status.Value = "AP Approved"
    ),
    "Status",
    Descending,
    "ID",
    Descending
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,523)