web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / sort gallery in ascend...
Power Apps
Unanswered

sort gallery in ascending order from a collection

(0) ShareShare
ReportReport
Posted on by 297

Hi all, 

 

I have a gallery that pulls info from a spreadsheet, inside the gallery is a label (CollectMileage) The label calculates distance from what you select in the dropdown (start) to another label in my gallery (end) using the below formula

"Milesfrom site " &BingMaps.GetRouteV3("Driving",Start.Selected.Result,End.Text,{distanceUnit:"Mile"}).travelDistance

 

Can i use this label (Collectmileage) as a collection and then filter sort the gallery to show how far people are in ascending order?

 

Gallery 

Filter(Table,Dropdown1 = Dropdown1.Selected.Result)

 

Label 

CollectMileage

 

I'm not great on powerapps so any help would be greatly appreciated. Or if you can tell me how to do it, even better!

 

Categories:
  • HectorOlivos Profile Picture
    411 on at

    You can try with ClearCollect() 

     

    You choose from starting the clearcollect OnStart App or from a button:

     

    ClearCollect(collectMileage, AddColumns(Table, "Mileage", BingMaps.GetRouteV3("Driving", Start.Selected.Result, End.Text, {distanceUnit: "Mile"}).travelDistance))

     

     

     

    Change your gallery Items to:

     

    Sort(collectMileage, Mileage)

     

     

     

    and in a label inside your gallery: 

     

    "Miles from site " & ThisItem.Mileage

     

     

     

    Hope this helps!

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard