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 / Gallery sorting that n...
Power Apps
Unanswered

Gallery sorting that no one can figure out

(0) ShareShare
ReportReport
Posted on by 297

Hi all, 

 

I have a formula in a label that calculates distance from two location, however as it's not pulled from a column i haven't been able to find a way to apply a sort to the gallery so i can sort the results in ascending order based on distance ( the label not connected to a column) I have added a picture, is there a way of doing this or work arounds?  so far no one has been able to answer previous posts 

jsmith87_0-1687380544555.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,460 Most Valuable Professional on at

    HI @jsmith87 ,

    You need to use AddColumns in the Gallery Items with the same formula as the Label - you can then sort of that column.

     

    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

  • jsmith87 Profile Picture
    297 on at

    Hi, Appreciate the help. Is there any way you could show me exactly how to do that? i've been on this issue for days and just want to sort it. I'd really appreciate it. 

  • jsmith87 Profile Picture
    297 on at

    Hi, Appreciate the help. Is there any way you could show me exactly how to do that? i've been on this issue for days and just want to sort it. I'd really appreciate it. 

  • WarrenBelz Profile Picture
    156,460 Most Valuable Professional on at

    Hi @jsmith87 ,

    You would need to use the actual fields containing those values (instead of the control content) with ThisItem in front, but the formula structure would be the same. As a word of caution here, last time I tried this in a gallery with Bing Maps, the  connector crashed due to too many concurrent queries.

  • jsmith87 Profile Picture
    297 on at

    Thank you, really appreciate the help 

  • jsmith87 Profile Picture
    297 on at

    Hi, 

    So i have input the add colums to a button which seems to works fine 

     

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

     

    However when i use this for my gallery i get loads of errors, can you let me where i'm going wrong please

     

  • WarrenBelz Profile Picture
    156,460 Most Valuable Professional on at

    Hi @jsmith87 ,

    As mentioned, you need to use the field names in your table (assuming the names as start and end here)

    AddColumns(
     Table,
     "Distance",
     BingMaps.GetRouteV3(
     "Driving",
     Start,
     End,
     {distanceUnit: "Mile"}
     ).travelDistance
    )

     

    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

  • jsmith87 Profile Picture
    297 on at

     

     

  • jsmith87 Profile Picture
    297 on at

    ignore that last picture, see below

     

    jsmith87_1-1687387609301.png

     

  • WarrenBelz Profile Picture
    156,460 Most Valuable Professional on at

    @jsmith87 ,

    Actually does not need ThisItem - see amended post

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard