Hi guys,
I know sort comes before filter but I have the below depending on the user which branch they select and which due month and the below works perfectly, however, the sorting button is not working and I tried to insert 'Sort' before and after 'Search' and I got errors.
Search(
If('CMB-Branch'.Selected.Result = "All" And 'CMB-DueMonth'.Selected.Result = "All",Stock,
'CMB-Branch'.Selected.Result = "All" And 'CMB-DueMonth'.Selected.Result <> "All",
Filter(Stock,DueMonth = 'CMB-DueMonth'.Selected.Result),
'CMB-Branch'.Selected.Result <> "All" And 'CMB-DueMonth'.Selected.Result = "All",
Filter(Stock, Branch = 'CMB-Branch'.Selected.Result
),
'CMB-Branch'.Selected.Result <> "All" And 'CMB-DueMonth'.Selected.Result <> "All",
Filter(Stock, Branch = 'CMB-Branch'.Selected.Result And DueMonth = 'CMB-DueMonth'.Selected.Result))
,'TXT-Search'.Text, "PartName", "MFGCode","Completed")
Thanks in advance.
Regards
Wessam
Hi @Samo2005
I have no idea what your formula does but I am assuming it produces a table.
With({tabl:
Search(
If('CMB-Branch'.Selected.Result = "All" And 'CMB-DueMonth'.Selected.Result = "All",
Stock,
'CMB-Branch'.Selected.Result = "All" And 'CMB-DueMonth'.Selected.Result <> "All",
Filter(Stock,DueMonth = 'CMB-DueMonth'.Selected.Result),
'CMB-Branch'.Selected.Result <> "All" And 'CMB-DueMonth'.Selected.Result = "All",
Filter(Stock, Branch = 'CMB-Branch'.Selected.Result),
'CMB-Branch'.Selected.Result <> "All" And 'CMB-DueMonth'.Selected.Result <> "All",
Filter(Stock, Branch = 'CMB-Branch'.Selected.Result And DueMonth = 'CMB-DueMonth'.Selected.Result)
),
'TXT-Search'.Text, "PartName", "MFGCode","Completed"
)},
Sort(tabl, somecolumn, Ascending
)
)
This should be the Items property of a gallery that shows your data sorted on one of the columns in the table that results from your searched If() function.
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 | |
70 | |
49 | |
36 | |
25 |
User | Count |
---|---|
239 | |
111 | |
89 | |
88 | |
66 |