Using the Bing Maps Actions in Power Automate

Using the Bing Maps Actions in Power Automate

  •  
  •  
  •  
  •  
  •  
  •  

Heyo!

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.

2.Click on the Sign in button.
3.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.
5. Fill out the account details screen.
6.Click Create.
7.Point to My account, and then select My Keys.
8.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 when finished.
9.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.
3.Click + Add an input.
4.Select Text.
5.Add text inputs for “lat” and “long”:
6.Click + New step.
7.Select the Get location by point (preview) action.
8.Add a connection name and the API key you obtained earlier and click Create.
9.In the Point latitude box, select the latitude coordinate dynamic content component from the Manually trigger a flow step:
10.Repeat for the Longitude step.
11.Click + New step and add the Compose action.
12.Select one or more of the Get location by point actions, such as Address formatted address.
13.Click Save.

 

You’ve got a flow!

Testing

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!

1.From the Flow creation page, click Test.
2. Select I’ll perform the trigger action and click Test.
3.If prompted, click Continue.
4.Enter the values in the Lat and Long fields. Lat is the value before the comma and Long is the value after the comma.
5.Click Run flow.
6.Click the link to go to the Flow runs page.
7.On the Run history, select the date for the run.
8.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.

Other Notes

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.

Published by Aaron Guilmette

Helping companies conquer inferior technology since 1997. I spend my time developing and implementing technology solutions so people can spend less time with technology. Specialties: Active Directory and Exchange consulting and deployment, Virtualization, Disaster Recovery, Office 365, datacenter migration/consolidation, cheese.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.