What property drives which colum will be sorted when tapping the sort ascending/decending icon? Mine seems to be doing it's own thing.
Solved! Go to Solution.
Hi
I tried also with your numbers, but it seems to work fine...
Could you please provide steps to reproduce the problem?
Thanks.
HI
Thanks for sharing.
My scenario very very straightforward. Just no idea why!
Hi hpkeong, I think it is because your "Number" field is actually text.
Does this work?
Sort( Table1, Value(Number))
I have display data from collection.
Dropdown list contain 3 values
Items = ["Name", "Maker","Price"]
- I have used Gallery to display data.
- When I select value from Dropdown list, Sorting work perfect. Let I selected Price from dropdown, then gallery display data sorted by Price. It works fine
- Now I want to apply Ascending / Decending on this sorted data when I click UpDown Icon. Please refer image for clarity of my question.
- How can I do this ?
Finally I got answer which is :
SortByColumns (PriceList,If(Dropdown.Selected.Value = "Name", "Name", Dropdown.Selected.Value = "Maker", "Maker", Dropdown.Selected.Value = "Price", "Price"), If(SortDescending1, Descending, Ascending))
When I use a people picker field like this "Employee" in the Search formula, it s giving me an error saying that "A field of text type is expected" and it is the same case with date type fields as well. Could you please let me know how can we use people picker and date fields in Search and SortByColumns formulas.
Dear Miss @aftowen
I've tried to sort the records with serial number like 1,2,3,4... with the code your provided, but unfortunately it's not performing well, like its sorting in 1,10,11,12.. 2,20,21..,3,30,31... and so on..
Please help how to fix this.!
For anyone who is discovering this thread like me and doesn't want to go on another goose chase for information:
When you've created an app that is just from one of MS' templates, and you want to edit the sort button to sort by a different criteria, you CAN NOT intuitively click on the sort button and edit the criteria in the formula for the button.
No, because this is MSFT with totally out of touch UX designers, you need to:
Click on the 'BrowseGallery1' and click the formula bar for that.
My formula is like this (also in screenshot):
SortByColumns(Filter([@'Customer Contacts'], StartsWith('Customer ID', TextSearchBox1.Text)), "Customer_x0020_ID", If(SortDescending1, Descending, Ascending))
The column that you sort by, is the second parameter/item in the syntax of the 'SortByColumns' function.
My source had a filter added to it which is for the search bar. However you can see that this filter is all in parentheses and makes up the first parameter, so the second parameter/item is "Customer_x0020_ID". So why am I sorting by that column name "Customer_x0020_ID" instead of just 'Customer ID' like in the 'Filter' function?
Because the trashcan design of this scripting language requires you to, in some instances, (so we can't even have consistency, yay) add "_x0020_" for every space in a column name. So "Customer_x0020_ID" actually translates to "Customer ID".
<minirant>
</minirant>
I've tried to make this less jargon-filled than some of the other answers and hope this can help anyone stumbling across this thread in the future.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
72 | |
50 | |
42 | |
30 |
User | Count |
---|---|
266 | |
121 | |
94 | |
90 | |
81 |