cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
heydamianards
Frequent Visitor

SortByColumn Formula

Hi All,

 

Currently, I'm having some troubles incorporating the SortByColumns formula to my PowerApps.

 

In my PowerApps, I have the filter gallery & search. (Please see screenshot)

 

PowerApps.PNG

 

For my filter gallery (Resolved, Active) here's the onselect formula:

If(
ThisItem.Title="Active",
UpdateContext({type : "Active"}),
ThisItem.Title = "Resolved",
UpdateContext({type : "Resolved"})
)

 

For my Browse Gallery here's the onselect formula:

Filter(
'M365 Service Health',StartsWith(Title,TextSearchBox1.Text),
If(
type = "Active" || type = "Resolved",
type in M365_Status2
))

 

I tried below formula for my browse gallery but it didnt work:

SortByColumns(Filter(
'M365 Service Health',StartsWith(Title,TextSearchBox1.Text),
If(
type = "Active" || type = "Resolved",
type in M365_Status2
)),
If(SortDescending1, Descending, Ascending))

 

Any one can assist me on this? Thank you so much

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User III
Super User III

The Column to sort on is not indicated:

SortByColumns(Filter(
'M365 Service Health',StartsWith(Title,TextSearchBox1.Text),If(type = "Active" || type = "Resolved",
type in M365_Status2
)), "ColumnToSort",
If(SortDescending1, Descending, Ascending))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

2 REPLIES 2
eka24
Super User III
Super User III

The Column to sort on is not indicated:

SortByColumns(Filter(
'M365 Service Health',StartsWith(Title,TextSearchBox1.Text),If(type = "Active" || type = "Resolved",
type in M365_Status2
)), "ColumnToSort",
If(SortDescending1, Descending, Ascending))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Hi @eka24 

 

Thank you so much. 🙂 

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 (91,417)