cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jasirqadri123
Helper I
Helper I

Get Multiple Filter and dropdown inserted in Gallery

Hi Everyone,

 

I am using this formula on my gallery to filter and sort the data of two columns, RoStatus and Technician.

 

SortByColumns(If(sortAll,Filter(RepairOrderTables,ROStatus = Dropdown.Selected.Value && Site = site.InventSiteId && (If(techAll,Technician = Dropdown1.SelectedText.Value,Site = site.InventSiteId))),Filter(RepairOrderTables,Site = site.InventSiteId && (If(techAll,Technician = Dropdown1.SelectedText.Value,Site = site.InventSiteId)))),"RepairOrderDate",If(SortDescending1,Ascending,Descending),"RepairOrder",Descending)

 

Now I have another column as Status Date and Order Date where I need to filter,sort .

 

Filter(RepairOrderTables,RepairOrderDate = Dropdown2.Selected.Result) -this I have used the formula .

 

Where I Can put it in the main formula as it is showing syntax error.

 

Need immediate help

 

1 ACCEPTED SOLUTION

Accepted Solutions

@jasirqadri123 ,

Just add it under the RepairOrderDate item with the same pattern and your Control Name - as I noted I am happy to help with code if you post your attempt at this.

View solution in original post

13 REPLIES 13
WarrenBelz
Super User
Super User

Hi @jasirqadri123 ,

Try the structure below - note that I cannot see your data types, so am assuming your references and underlying logic are correct.

SortByColumns(
   Filter(
      RepairOrderTables,
      (
         !sortAll ||
         ROStatus = Dropdown.Selected.Value
      ) && 
      Site = site.InventSiteId && 
      (
         techAll ||
         Technician = Dropdown1.SelectedText.Value
      ) &&
      RepairOrderDate = Dropdown2.Selected.Result
   ),
   "RepairOrderDate",
   If(
      SortDescending1,
      Ascending,
      Descending
   ),
   "RepairOrder",
   Descending
)

 

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

jasirqadri123
Helper I
Helper I

This structure is not neither filtering nor sorting.

 

I need to sort and filter both Order Date and Status Date Coloumns.

 

How to do that

jasirqadri123
Helper I
Helper I

For Dropdown ,ROStatus:

Onchange: If(Dropdown.SelectedText.Value = "ALL",Set(sortAll,false),Set(sortAll,true))

Items: ["ALL","New","Received"]

Default: "ALL"

 

For dropdown: Technician:

OnSelect: ClearCollect(Tech,Distinct(RepairOrderTables,Technician));Collect(Tech,{Result:"ALL"});

OnChange: If(Dropdown1.SelectedText.Value = "ALL",Set(techAll,false),Set(techAll,true))

Items: Tech

Default: techAll

 

@jasirqadri123 ,

I can assure you it is doing both (Filtering and Sorting) - not sure how you arrived at that opinion.

I am a little unclear on your logic, but it is Filtering on ROStatus if your Variable SortAll is true and by Technician if the Variable TechAll is false (which it appears you wanted in your original posted code)

jasirqadri123
Helper I
Helper I

How can i then filter and sort the columns for orderdate and status date 

jasirqadri123
Helper I
Helper I

Can you give the correct formula to implement as I have tried so many times but it is not working

@jasirqadri123 ,

"Not working" does not help me - the code I posted is my best interpretation of your post requirements with the information you had currently provided. It is valid syntax and assumes the values you posted (I cannot see your data or app structure) are valid. Are you getting errors (if so what) or if not working, what is the issue?

You have also stated now you have another drop-down setting the variable - can you please state which drop-down names are ROStatus and Technician.

The structure you provided is not showing any error instead the records in gallery are wind off ,when i put your formula on gallery(items). Yes I have two dropdowns, RoStatus and technician in my gallery.

@jasirqadri123 ,

I cannot see your data, app or read your mind here and the short responses are not helping. What are the actual control names of these drop downs (so I can understand what references belong to them) and also can you please provide a short explanation of the desired result and what controls are relevant to getting this.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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