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
Solved! Go to Solution.
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.
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
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
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
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)
How can i then filter and sort the columns for orderdate and status date
Can you give the correct formula to implement as I have tried so many times but it is not working
"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.
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
187 | |
53 | |
52 | |
38 | |
37 |
User | Count |
---|---|
282 | |
97 | |
86 | |
80 | |
77 |