cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimboSey
Helper III
Helper III

Sort my Gallery by date

Hi,

 

I have a PoweApp which contains a Gallery from a SharePoint list. I have various filters applied to the item of the Gallery 

 

My problem is, I would now like to sort the gallery by the 'currentexpectedenddate' column in my SharePoint list. I need it to be oldest first.

 

The coding I have currently in my Gallery is:

 

If(

   //This is for all and all

    DD_HLWorkPlan_2.Selected.Value = "All" And DD_HLProductTitle_2.Selected.Value = "All",

    JSConsolidationProductTitle,

    //This is for all Workplans and  Product Title

    DD_HLWorkPlan_2.Selected.Value = "All" And DD_HLProductTitle_2.Selected.Value <> "All",

    Filter(

        JSConsolidationProductTitle,

        'Product Title'.Value = DD_HLProductTitle_2.Selected.Value

    ),

//This is for selected Workplans and all Product title

    DD_HLWorkPlan_2.Selected.Value <> "All" And DD_HLProductTitle_2.Selected.Value = "All",

    Filter(

        JSConsolidationProductTitle,

        PT_WorkPlanChoice.Value = DD_HLWorkPlan_2.Selected.Value

    ),

//This is for selected Workplans and selected Product tile

    DD_HLWorkPlan_2.Selected.Value <> "All" And DD_HLProductTitle_2.Selected.Value <> "All",

    Filter(

        JSConsolidationProductTitle,

        PT_WorkPlanChoice.Value = DD_HLWorkPlan_2.Selected.Value And 'Product Title'.Value = DD_HLProductTitle_2.Selected.Value

    )

)

 

What do I need to add to apply the sorting of the column in Sharepoint so my gallery shows oldest expected end date.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @JimboSey ,

Try this

Sort(
   Filter(
      JSConsolidationProductTitle,
      (
         DD_HLWorkPlan_2.Selected.Value = "All" ||
         PT_WorkPlanChoice.Value = DD_HLWorkPlan_2.Selected.Value
      ) &&
         DD_HLProductTitle_2.Selected.Value <> "All" ||
        'Product Title'.Value = DD_HLProductTitle_2.Selected.Value
      )
   ),
   currentexpectedenddate
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @JimboSey ,

Try this

Sort(
   Filter(
      JSConsolidationProductTitle,
      (
         DD_HLWorkPlan_2.Selected.Value = "All" ||
         PT_WorkPlanChoice.Value = DD_HLWorkPlan_2.Selected.Value
      ) &&
         DD_HLProductTitle_2.Selected.Value <> "All" ||
        'Product Title'.Value = DD_HLProductTitle_2.Selected.Value
      )
   ),
   currentexpectedenddate
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Thank you, this worked great, I put the Sort before my If and currenexpected end date at the end of my coding. Works as I need it.

 

Thanks again.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,751)