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

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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,833)