Ever thought it would be nice to know how long it takes to get from where you are to a functional location in Asset Management (AM)? With Power Apps and Bing Maps you can.
In this blog post, I will explore how we can enrich the AM experience with routing capabilities using Bing Maps. Bing Maps, as you know, provides various mapping capabilities and is a native Power Apps connector (in preview). It comes with an API that allows us to call various mapping functions.
Please note that Bing Maps is a paid service so you need to sign up and generate an API key before you can use the service.
In this small example, I have used Bing Maps in a Power Apps app to show routing information between my current location and the location of the selected functional location in AM. This is what the app looks like:
As you can see, the app displays my current location and the location of the asset (functional location). Bing Maps calculates distance, duration and estimated arrival time between the two locations and displays a short route description. Optionally, we can select what to avoid on the route.
Once you have added Bing Maps to your app as a data source, it is relatively easy to call the service using the API.
The idea was to provide routing capabilities in AM. To achieve this, I have embedded the app in the Functional Locations details page. By providing the functional location ID to the app, I can look up the primary address and use this as the routing endpoint.
This is what it looks like:
As you can see from the above screenshot, I have added a new tab to the screen called Routing Information through personalisation.
When the tab is expanded you can see that the app is now embedded directly in the user interface and since the functional location can be passed to the app, it is also context sensitive.
When I toggle the Avoid motorways option, the app instantly recalculates the distance and duration as shown below.
This was just one example of how we can leverage online services to enrich the Dynamics 365 Finance and Operations experience using the Power Platform.
In a coming blog post, I will look at the mechanics behind the app and show how easy it is to interact with the Bing Maps API.