Hello everyone,
I hope you're all doing well. I'm currently facing an issue with sorting dates in a dropdown menu that I've populated from a collection in Power Apps. The dates are currently displayed in cardinal number order, but I need them to be sorted chronologically.
I have a collection that contains date values, and I'm using that collection as the data source for my dropdown menu. I used this formula to populate the collection:
ClearCollect(colEmbarques;AddColumns(EMBARQUESs;"DataFormatadaEmbarques";Text(cr59e_datadesadabrasil;DateTimeFormat.ShortDate)))
However, when I display the dates in the dropdown, they appear like this:
With this formula on Items:
Sort(Distinct(colEmbarques;DataFormatadaEmbarques);Value;If(SortDescending1;SortOrder.Descending;SortOrder.Ascending))
I believe I need to apply another type of sorting function or formula to the collection after populating the dropdown, but I'm not sure how to achieve this. Can someone please guide me on how to sort the dates in the dropdown menu in chronological order?
Any assistance would be greatly appreciated. Thank you in advance!
Thanks, it worked!
Hi @Diving3565 ,
Please try:
Sort(Distinct(colEmbarques;DataFormatadaEmbarques);DateValue(Value;"de");If(SortDescending1;SortOrder.Descending;SortOrder.Ascending))
Best Regards,
Bof
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional