When you have an app that has a current location and a destination postcode and you want to calculate travel distances, you could use Power Automate.
To use the Bing Maps connector you will first need to create a Bing Maps account.
Visit the Bing Maps Developer site then you will need to create an account. Once you have an account there is the option My account -> My Keys. And you can simply login with your Microsoft 365 account so this is all quite easy.
This is where we can get our API key:
Just supply the key details in the Create key pane and then the key will be made available
Just click on the Show key and copy the key.
Calculate travel distance in Power Automate
I’m creating a flow that has a Get route action in it.
The above action might look slightly clumsy, but it is very good. the comment is suggesting that a longitude and latitude is need but you can actually use postcodes. The actions are even clever enough to identify which country the codes are for. Well, it worked for UK postscodes at least.
So in my example I’m taking two postcodes. The first postcode is in Windsor and the second postcode is 10 Downing Street.
When we now run the flow we would get the distance in kilometres. So I changed this to miles as the UK uses miles for distance.
So if we now run our flow we will get the following output:
We can see the distance between two postcodes. The normal travel duration and the current travel duration with the traffic taken into account.
So by using just one simple action you can calculate travel distances within Power Apps. It cannot get much easier than that.