cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alois
Helper III
Helper III

Calculating Distance between Two Points in Forms

Hi all,

Attached is a sample copy of a customizable form I'm doing. 

My objective is to calculate the distance between two inputs - Vendor Address and Destination. I understand that this can be done using the BingMap get distance function. However. this will require the data source as BingMap. In this case, my datasource is a form linked to a sharepoint list. How do I achieve my goal?

Alois_0-1602497101034.png


Thanks,
Alois

1 ACCEPTED SOLUTION

Accepted Solutions
rsaikrishna
Super User
Super User

@Alois 

 

Add BingMaps data source to your app. 

 

In the your SharePoint list form, select data card for Distance control. 

 

In the default & Update property, place the following formula:

BingMaps.GetRoute(tbVendorAddress.Text, tbDestination.Text).travelDistance

 

If you want the Units of distance as well, then you can postfix the above value with distanceUnit

 

Give a try and share your results.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

View solution in original post

3 REPLIES 3
rsaikrishna
Super User
Super User

@Alois 

 

Add BingMaps data source to your app. 

 

In the your SharePoint list form, select data card for Distance control. 

 

In the default & Update property, place the following formula:

BingMaps.GetRoute(tbVendorAddress.Text, tbDestination.Text).travelDistance

 

If you want the Units of distance as well, then you can postfix the above value with distanceUnit

 

Give a try and share your results.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

Thank you so much for the help! How do I postfix the units?

RamyaSai
Regular Visitor

PLease let me know how to do the same based on sharepoint List

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,915)