I have a problem in my app with the EditForm generated from a sharepoint list (called 'Hours') in which I have a lookup field based on another sharepoint list 's column (called 'Project') containing the projects' names. The aim is to select a project from the dropdown list of project names to associate with the work hours that are entered in another datacard. Now, the display of my sharepoint list 'Project' alphabetizes the projects by their name and when I enter work hours in the sharepoint 'Hours', the dropdown list of project names is correctly displayed (in alphabetical order). But when I'm using the app, the dropdown list of project names, in the EditForm of the sharepoint list 'Hours', displays the project list in the order I entered them. Does anyone have any idea on how I can fix this and get the list in alphabetical order?
I don't have any item field in the EditScreen generated from my sharepoint or in the DataCard or DataCardValue in question. To what should I apply it?
You could use SortByColumns(<datasource>, "<SharePointFieldToSortOn>", If(SortDescending1, Descending, Ascending))
Hope this helps.
If this reply has answered your question or solved your issue, please mark this question as answered.
Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.
I wanted to use the autogenerated control for this but there is no access to the items. I tried creating a new control in my form and using the formula you mentionned but that is not working either. As I said, the order in the dropdown diplayed in sharepoint is correct but not in powerapp. I'm starting to think this might be a bug.
Still haven't found a solution to my problem : I'll try to rephrase it.
I have an EditForm generated from a sharepoint list Hours. In Hours, I have a Research column which is giving a choice between different project listed in another sharepoint Project. The projects listed in Project are ordered by alphabetical order as well as in the dropdown list displayed in Hours. Now when I generate an EditForm from this, the dropdown list in the app (DataCardValue) lists the projects by the order in which they were entered in Project.
The autogenerated dropdown control in the EditForm (DataCardValue), corresponding to the Research column in Hours, doesn't contain any item field allowing to sort the choices, as suggested by @KC and @Tom_Slosse. I tried to work around the problem by inserting a new DropDown control with items sorted from the Project list, but I couldn't figure how to get this accepted in the EditForm for the sharepoint Hours.
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.
At the monthly call, connect with other leaders and find out how community makes your experience even better.