I’m working on a project that needs geocoding and decided to see what Power Automate actions are available to me. Sure, I could construct an HTTP REST call to a service, but maybe there’s any easier way?
Enter the Bing Maps connector.
Configuring a Bing Maps Account
First, you’ll need a Bing Maps dev account.
Click on the Sign in
If you’re already signed in to Azure AD with an enterprise user, it should recognize you and prompt you to create a Bing Maps Dev account. Otherwise, you can sign with any ID available to you or create one if you don’t have it.
4.Click Yes, let’s create a new account.
Fill out the account details screen.
Point to My account
, and then select My Keys
Fill out the value to create a new key. You’ll need to enter an application name (which is how you will identify particular API transactions), a Key Type, and an Application Type. I recommend you select Dev/Test
to learn how this process works. Click Create
Once the key has been created, you can click Show key
to display your key or Copy key
to put it in your clipboard. Either way, you’ll need this later on for adding to a flow.
Woot! Now you’ve got a key!
Using Bing Maps with Power Automate
Next, we’ll plug it in to Power Automate. In this example, we’re just going to create a manual flow where we put in latitude and longitude manually through a text input, but you can deliver it any way you like.
1.Navigate to Power Automate and log in.
2.Click + Create and select Manual.
Click + Add an input
Add text inputs for “lat” and “long”:
Select the Get location by point (preview)
Add a connection name and the API key you obtained earlier and click Create
In the Point latitude box, select the latitude coordinate dynamic content component from the Manually trigger a flow
10.Repeat for the Longitude step.
Click + New step
and add the Compose
Select one or more of the Get location by point
actions, such as Address formatted address
You’ve got a flow!
Next, we can test it using some coordinates.
You can find coordinates for a location using Bing or Google maps. For example, using Bing Maps, you can right-click on the map and select Copy to get the coordinates.
Once you’ve got your coordinates, you’re ready to go!
From the Flow creation page, click Test
Select I’ll perform the trigger action
and click Test
If prompted, click Continue
Enter the values in the Lat
fields. Lat is the value before
the comma and Long is the value after
Click the link to go to the Flow runs page
On the Run history
, select the date for the run.
Expand the Compose
window to see the translation of the coordinates to an address.
Woot! You’re done. You can also expand the Get location by point action to see the values for all of the fields that are presented. These outputs can also be used as part of your flow.
If you tried naming the manual input fields something like “Latitude” and “Longitude,” you probably received an error that those names are already in use. Power Automate does include the ability to capture the geolocation of the device submitting the flow, so you are more than welcome to use those. In this case, I wanted to demonstrate using coordinates that the user supplies manually to test—that way, if you are supplying coordinates via another mechanism, you can be sure that it works.
If you want to retest using your device’s own coordinates, simply update the fields in the Get location by point action to use the Latitude and Longitude built-in dynamic content tokens.