cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dev88
Frequent Visitor

Bing Get Route - Travel Time and Distance

Hello,

I am new to this community but hopeful I support on this issue.

 

Target :

To get travel time and distance to add in a column in a Sharepoint List.

 

What’s working :

Bing Get Route is connected successfully and produces the right output when viewed after the flow runs.

 

Whats not working :

When using Travel Distance or Time dynamic output in the Sharepoint update item, it returns an empty field.

 

What was attempted :

compose, convert to string and all whats entering in any flow after the bing get route passes no data.

 

everything seems to run as it should but outputs are not showing as expected.

 

Assistance would be truly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Dev88,


I can reproduce this behaviour when I use the TravelDistance field myself. When I peek the code of that column it points to body/TravelDistance.

 

However, that doesn't correspond with the schema of the response of the Get Route action. It probably is a bug in the connector.

 

To workaround this you could use this expression in a compose action to get the total distance of your route:

 

outputs('Get_route')?['body']['resourceSets'][0]['resources'][0]['travelDistance']

 

 

For travel duration in seconds you could use this expression:

 

outputs('Get_route')?['body']['resourceSets'][0]['resources'][0]['travelDuration']

 

 

For travel duration with traffic in seconds you could use this:

 

outputs('Get_route')?['body']['resourceSets'][0]['resources'][0]['travelDurationTraffic']

 

 

 

View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @Dev88,


I can reproduce this behaviour when I use the TravelDistance field myself. When I peek the code of that column it points to body/TravelDistance.

 

However, that doesn't correspond with the schema of the response of the Get Route action. It probably is a bug in the connector.

 

To workaround this you could use this expression in a compose action to get the total distance of your route:

 

outputs('Get_route')?['body']['resourceSets'][0]['resources'][0]['travelDistance']

 

 

For travel duration in seconds you could use this expression:

 

outputs('Get_route')?['body']['resourceSets'][0]['resources'][0]['travelDuration']

 

 

For travel duration with traffic in seconds you could use this:

 

outputs('Get_route')?['body']['resourceSets'][0]['resources'][0]['travelDurationTraffic']

 

 

 

View solution in original post

Dev88
Frequent Visitor

@Expiscornovus you are awesome, this worked like a charm !. 

eugacc
Advocate II
Advocate II

Thank you for work around! Definitely a bug. Odd that if to use existing  template from library that use Bing Connector to calculate distance it works correctly. Adding within flow yes, doesn't return results. Copy and trying paste to another gave error that Schema doesn't match. 

Dev88
Frequent Visitor

Update 08/31/21 : 

 

Noticed that the flow is now failing due to wrong expression was working fine and after looking into it It seems that its now fixed and the right expression now is now without ['resourceSets'][0]['resources'][0].

 

Distance : 

 

outputs('Get_route')?['body']['travelDistance']

 

Duration : 

outputs('Get_route')?['body']['travelDuration']

 

Duration with Traffic : 

 

outputs('Get_route')?['body']['travelDurationTraffic']

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,232)