Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Sorting a gallery

Like (1) ShareShare
ReportReport
Posted on 12 Sep 2024 15:12:51 by 6
I have a power app screen with gallery displaying records from a SharePoint list, the items property has the following filter logic, I would like to sort the records descending by ID number, could some one help me and updating the below logic to apply sorting please.
 
 
If(
    varTabSelected = 3,
   Filter( HelpDesk,Gallery3_1.Selected.Value="Open" && Status.Value <> "Resolved" && Status.Value <> "Cancelled" && Status.Value <> "Rejected" ||Gallery3_1.Selected.Value="All"  || Status.Value = Gallery3_1.Selected.Value),
   //Filter( HelpDesk,Gallery3_1.Selected.Value="Open" && Status.Value <> "Resolved" && Status.Value <> "Cancelled" || Status.Value = Gallery3_1.Selected.Value),
   //Filter( HelpDesk,Gallery3_1.Selected.Value="All",Priority.Value = "High" && Status.Value <> "Resolved"||( Status.Value = Gallery3_1.Selected.Value && Priority.Value = "High" && Status.Value <> "Resolved")  ),
   Filter( HelpDesk,Gallery3_1.Selected.Value="Open",Priority.Value = "High" && Status.Value <> "Resolved" && Status.Value <> "Cancelled" && Status.Value <> "Rejected" )
)
 
  • Suggested answer
    FLMike Profile Picture
    FLMike 27,286 on 12 Sep 2024 at 20:26:48
    Sorting a gallery
    Hi try this
     
    SortByColumns(
    If(
        varTabSelected = 3,
       Filter( HelpDesk,Gallery3_1.Selected.Value="Open" && Status.Value <> "Resolved" && Status.Value <> "Cancelled" && Status.Value <> "Rejected" ||Gallery3_1.Selected.Value="All"  || Status.Value = Gallery3_1.Selected.Value),
       Filter( HelpDesk,Gallery3_1.Selected.Value="Open",Priority.Value = "High" && Status.Value <> "Resolved" && Status.Value <> "Cancelled" && Status.Value <> "Rejected" )
    ),
    "ID", SortOrder.Descending)
     
     
    And I removed your comment out code, so hopefully i didnt miss anything
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,696

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,456

Leaderboard
Loading complete