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 / BingMaps.GetRoute - ca...
Power Apps
Unanswered

BingMaps.GetRoute - calculate distance and duration in 1 request

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

i am using Bingmaps.GetRoute in a label within a gallery (as i have to calculate distance and duration for multiple people listed in the gallery). I have currently got 2 separate BingMaps.GetRoute() labels - 1 for distance and 1 for duration. however this makes double the API call. I want to be able to retrieve the JSON in 1 call and use this 1 response to just show duration and distance either in 2 separate labels (ideally) or in 1 if needs be.

 

Thanks

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I did a test for you .

    1\ This is my test collection 'Col'.

    v-xiaochen-msft_0-1616652386631.png

     

    2\ Add a gallery control and set its Items property to:

    AddColumns(Col,"Test",BingMaps.GetRoute(A,B))

     

    3\ Insert a label into gallery and set its Text property to:

    ThisItem.Test.travelDistance

     

    4\ Insert a label into gallery and set its Text property to:

    ThisItem.Test.travelDuration

     

    5\ The result is as follows:

    v-xiaochen-msft_1-1616652506729.png

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, the issue or what i think the issue is that my gallery is currently filtered by a drop down that the user selects from a list of options and this brings back users and their post code from CDS. How do i add the postcode labels to the collection- they will change according to the drop down option and the users in the list. Also how do i then use addcolumns with the filter on the gallery which is currently - filter('table' -from cds, name in combobox.selecteditems.name) as the user can select multiple options from the combo box

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Addcolumns() function can be used on cds directly , you don’t need to create another collection.

     

    So, you could use this formula on Items property of gallery control.

    Addcolumns(filter('table' -from cds, name in combobox.selecteditems.name),New Name,BingMaps.GetRoute(...,...) )

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     

    MSC01_8-1616774290083.png

     



     

    Hi, when i use a collection of the user postcode it brings it back in what seems to be a nested collection. 
    The first image is what i see initially, followed by image 2 when i click into postc and if i click into any of the nested collections it shows the users post code under text. I just need the collection to retrieve the userpostcode which is the Text and destination, which i have no idea how to do. As shown below the post codes are currently listed in a gallery connected to cds table. The user can enter the destination which will be the same for all users in the gallery.

     

    MSC01_9-1616774455626.png

     

     

     

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Please try ungroup() function.

    For example:

    This is my test collection.

    v-xiaochen-msft_0-1616981492980.png

    v-xiaochen-msft_1-1616981505362.png

    v-xiaochen-msft_2-1616981517898.png

     

    Use this formula:

    Ungroup(Ungroup(Col3,"Haha"),"Test2")

     

    The result is as follows:

    v-xiaochen-msft_3-1616981583403.png

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    thanks for the response, the ungroup worked just by using one ungroup(collection, "postcode"), however what do i do if there is more than 1 nested table to access and need to combine the data. 

    MSC01_0-1617119588192.png

    also if i try to do addcolumns to the filtered gallery, it doesnt work as i need to use the collection data with addcolumns . i want to be able to ideally use the collection data which gets the bingmaps data and bring it back to the same filtered gallery

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard