Hi Guys,
Was wondering how to sort a collection and save the results within the actual collection.
Example I want to sort collection 'mycol' column 'Type' in alphabetical order. I want the collection to rearrange in this order.
I know how to show it sorted in tables, a gallery, dropdown list etc. Although, I want to rearrange the data at the source which is within my actual collection.
Any help is greatly appreciated.
Thanks
Yes, this is a much cleaner solution as you don't have a temporary collection laying around taking up memory as well.
Hi @christian12 ,
You can do it in one action like this
With(
{wCol: mycol},
ClearCollect(
mycol,
Sort(
wCol,
Type
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
The easiest way would be to create a temporary collection and then clear collect the results of that back to the real collection.
ClearCollect(myTempCollection, Sort(mycol, Type));
ClearCollect(mycol, myTempCollection);