cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Yaga
Level: Power Up

how to get City name only from BingMaps API (getlocationbypoint)?

Hello all,

i am trying to retrieve automatically the CITY the user is in with a getlocationbypoint function.

I manage to retrieve the total address but not the CITY only.

 

BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude).address.

has the following fields options:

- addressLine

- countryRegion

- countryRegionIso2

- formattedAddress

- postalCode

 

but there is no CITY or LOCALITY option.

Thanks for your support!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: how to get City name only from BingMaps API (getlocationbypoint)?

Hi @Yaga ,

The reason why you met this problem is that the response of BingMaps.GetLocationByPoint function does not include CITY or LOCALITY option.

Here are all of the responses of BingMaps.GetLocationByPoint function:

Name Path Type Description
Line
address.addressLine string

The official street line of an address.

Country Region
address.countryRegion string

Country or region name of an address.

Country Region ISO 2
address.countryRegionIso2 string

The two-letter ISO country code.

Formatted Address
address.formattedAddress string

A string specifying the complete address.

Postal Code
address.postalCode string

The post code, postal code, or ZIP Code of an address.

Confidence
confidence string

The confidence of the match.

Entity Type
entityType string

A type of location. Examples include PopulatedPlace and Monument.

Name
name string  
Latitude
point.coordinates.latitude float

The latitude point that was used for the location.

Longitude
point.coordinates.longitude float

The longitude point that was used for the location.

Combined
point.coordinates.combined string

Comma separated latitude and longitude values.

Type
point.type string

type

In the list, I suggest you refer Country Region and Formatted Address, these two fields may include the information of city.

For now, the standard BingMaps connector does not has a kind of response including CITY or LOCALITY directly.

Here's a doc about this connector for your reference:

https://docs.microsoft.com/en-us/connectors/bingmaps/#getlocation_response

 

If you want to get this city value directly, I suggest you try to build a custom connector.

Here's a doc about how to build a custom connector for your reference:

https://docs.microsoft.com/en-us/connectors/custom-connectors/define-blank

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: how to get City name only from BingMaps API (getlocationbypoint)?

Hi @Yaga ,

The reason why you met this problem is that the response of BingMaps.GetLocationByPoint function does not include CITY or LOCALITY option.

Here are all of the responses of BingMaps.GetLocationByPoint function:

Name Path Type Description
Line
address.addressLine string

The official street line of an address.

Country Region
address.countryRegion string

Country or region name of an address.

Country Region ISO 2
address.countryRegionIso2 string

The two-letter ISO country code.

Formatted Address
address.formattedAddress string

A string specifying the complete address.

Postal Code
address.postalCode string

The post code, postal code, or ZIP Code of an address.

Confidence
confidence string

The confidence of the match.

Entity Type
entityType string

A type of location. Examples include PopulatedPlace and Monument.

Name
name string  
Latitude
point.coordinates.latitude float

The latitude point that was used for the location.

Longitude
point.coordinates.longitude float

The longitude point that was used for the location.

Combined
point.coordinates.combined string

Comma separated latitude and longitude values.

Type
point.type string

type

In the list, I suggest you refer Country Region and Formatted Address, these two fields may include the information of city.

For now, the standard BingMaps connector does not has a kind of response including CITY or LOCALITY directly.

Here's a doc about this connector for your reference:

https://docs.microsoft.com/en-us/connectors/bingmaps/#getlocation_response

 

If you want to get this city value directly, I suggest you try to build a custom connector.

Here's a doc about how to build a custom connector for your reference:

https://docs.microsoft.com/en-us/connectors/custom-connectors/define-blank

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Yaga
Level: Power Up

Re: how to get City name only from BingMaps API (getlocationbypoint)?

Many thanks Phoebe!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,122)