Forum Discussion
How do I order the selection in a lookup field?
Is there a way to accomplish this?
- rkirk2kDec 20, 2022Copper Contributor
rkirk2k I WAS ABLE TO SOLVE THIS...
For whatever reason, PowerApps insists on presenting the choices in alphabetical order, EVEN THOUGH the list was created in the desired order (AND EVEN AFTER I went in and sorted the default view of the targeted list on the column holding the choices) So WEIRD.
So, I actually had the items in the list in the order I wanted.Meaning - the ID field was in the correct order, but the column I was rendering continued to be displayed alphabetically. I had to force the choice control in PowerApps to sort based on the ID field in ascending order. It looked like this...
Sort(Choices([@LIST_NAME].LOOKUP_COLUMN),Id,Ascending)- carlos_grando_1987Jan 13, 2023Copper Contributor
rkirk2k Awesome solution!
The only change I would suggest on your code is change the colons by semicolons: before this, PowerApps was pushing some syntax errors (at least in my current version at 2023, January).
So, instead of:
Sort(Choices([@LIST_NAME].LOOKUP_COLUMN),Id,Ascending)
I would suggest someone to also try what worked for me:
Sort(Choices([@LIST_NAME].LOOKUP_COLUMN);Id;Ascending)Thank you!