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, there is no small limit to nesting of If statements that I am aware of, so three should be fine.
Why is there a Search function in your Items property without any search parameters?
As one small follow up, I've tried sorting by a third value, DEF, however whenever I try to add this as a third If condition, nothing seems to work, are conditions locked to 2 max or is there some sort of workaround?
Sorry for intervening into the discussion. May I suggest another way?
You can still maintain the TextSearchBox, and replace the Sorted Column with DropDown.
- Create a Dropdown with: Items = ["Name", "ATK", "DEF']
- Replace the Sorted column, example, Name, with Dropdown.Selected.Value
SortByColumns(Search(MyDataSource, TextSearchBox1.Text, "Name", "ATK", "DEF"), Name, If(SortDescending1, Descending, Ascending))....Replaced with
SortByColumns(Search(MyDataSource, TextSearchBox1.Text, "Name", "ATK", "DEF"), Dropdown.Selected.Value, If(SortDescending1, Descending, Ascending))
So, when you Select the items in the Dropdown, and press on Sort (Up-Down Arrow) button, it will sort based on the dropdown selected button.
Please see my sample and hope it meets what you want in a simple way.
To answer the Search parameter question, that is there because in my actuall app I am seraching for things, I did not want to post all of the parameters here.
I also managed to solve the issue with certain numbers not sorting correctly, this was because they were being sorted as plain text rather than as variables.
Finally I Also Fixed the third If statement Issue, I was doing something slightly wrong with the close brackers, everything is working how I would like it to, but thanks again for the response SteelMan.
That worked! (I am going to put an idea in that they made the change behind the scenes as the gallery items are selected.)
I have added in this thread that you can use Dropdown.Selected.Value to replace the Sorted Column and bind to a Dropdown to make the sorting a dynamic one based on what you select.
Please see my reply in one of the thread here.
All methods are OK to you.
I just wish to share another option that just add a dropdown without adding many Sorting Buttons.
A quick question about how things are sorted with the drop down, I am running into an issue that I had previously when sorting DEF with the previous version. DEF are numerical values, and I believe because powerapps was taking the numbers as plain text values, when they were sorted they would appear as such:
When what I would want would be:
To fix this issue I made sure that when sorting by ATK I sorted by its value, for example:
Sort(Search(MyDataSource, TextSearchBox1.Text, "NAME", "ATK", "DEF"), Value(DEF), If(SortDescending3, Descending, Ascending))
Now when sorting with the dropdown, it takes the value of the selected item on the list, but returns the plaintext sorted list rather than the value sorted list, which is not what I want:
SortByColumns(Search(MyDataSource, TextSearchBox1.Text, "NAME", "ATK" ,"DEF"), Dropdown1.Selected.Value, If(SortDescending1, Ascending, Descending))
I've tried Value(Dropdown1.Selected.Value) and I've tried making the Items in the dropdown Value("ATK") but neither of these seem to work, would you know why this is happening?
I tried, too, on Sample Data from Tutorial.
Even the sample data shown also can;t sort as expected for NUMBER.
In this case, I am sorry for not able to provide solution ehere and hpe someone or PG can come it to help clarify the proper solution to sort Number, in dequence (instead of of based on the 1, 2, 3, 4,...).
Sample screenshot of failure.
In fact, Sorting is possible except when you have 1, 2, 3, 4,...10, 11,12,...and above.
1 ~ 10 will affects the sorting.
1, 10, 11, 2, 12, 3, 4, 5, 6, 7, 8,...
So, if you do not hvae 1 ~ 10, but start from 10, it has no problem,
Check out new user group experience and if you are a leader please create your group
Check out how to claim yours today!
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks