web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

GPS into BIng API

(0) ShareShare
ReportReport
Posted on by 909

Hello,

 

Scenario:

I would like to save user GPS coordinates - send them to BING API and return with a City, postal code and detailed address.

And then save this translated data to Sharepoint list.

I want it like that to be able to show this data in a gallery. Latitude and Longtitude is not very good for human beings 😉

 

Is that possible?

I would like to use this free Bing API (120 k yearly).

 

Please provide some examples.

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Elitezone :

    For now, the standard BingMaps connector does not has a kind of response including CITY or LOCALITY directly.But the detailed address and zip code can be obtained directly.I'v made a test for your reference:

    1\Add a button and set it's OnSelect Properyt to:

     

    Set(TheVar,BingMaps.GetLocationByPoint(Location.Latitude,Location.Longitude)); /*TheVar is my custom variable*/
    Collect(TheLocation,{PostalCode:TheVar.address.postalCode,Address:TheVar.address.formattedAddress})/*TheLocation is my custom collection*/

     

    75.gif

    Best Regards,

    Bof

  • Elitezone Profile Picture
    909 on at

    @v-bofeng-msft 

    ok it works, and it's great. 

    I used this function to show values in label:

     

    First(TheLocation).PostalCode / Address

     

     

    Now the last part. How to save those two values into sharepoint list.

    Let's say I have a sharepoint list address and postal code.

    Postal code should be a single text, and address a multine?

     

    And that should be a patch function?

    I already have a patch function in this section:

     

    Patch(Obrazy_obecnosc, Defaults(Obrazy_obecnosc), {Title: TextInput2.Text, 'Informacje o obrazie': First(CameraImage).Url})

     

     Fields Address and postal code are added to sharepoint List Obrazy_obecnosc.

     

    One last question - how can I reset this TheVar value to blank?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Elitezone :

    I assume there are two fields in Obrazy_obecnosc:

    • PostalCode-Text
    • Address-Text

    Please try this code:

    Set(TheVar,BingMaps.GetLocationByPoint(Location.Latitude,Location.Longitude));
    Patch(
     Obrazy_obecnosc, 
     Defaults(Obrazy_obecnosc),
     {
     Title: TextInput2.Text,
     'Informacje o obrazie': First(CameraImage).Url
     PostalCode:TheVar.address.postalCode,
     Address:TheVar.address.formattedAddress
     });
    Set(TheVar,Blank());

    Best Regards,

    Bof

  • Elitezone Profile Picture
    909 on at

    @v-bofeng-msft 

    It was working and showing good address on my company PC, but when I use my notebook or personal PC it shows a city 100 km away from me. Only my phone collect localisation correctly. Does it mean that it works only on devices with GPS?

     

    Is there any way to improve it?

    I thought that this will work on PC also somehow, but this will be useless to everyone without phones or GPS computers.

     

    This was my method of checking if users are staying at a correct place.

     

    Some users also reported that they receive error:

    BingMaps.GetLocationByPoint failed: The method GetLocationByPoint has an invalid value for parameter 'latitude'

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Elitezone :

    It depends on the default address of your computer.I think this link will help you a lot:

    Windows 10 location service and privacy 

    Best Regards,

    Bof

  • Elitezone Profile Picture
    909 on at

    @v-bofeng-msft 

    Meanwhile google map pin point correct address on every place in the Europe in web browser ;(

    I wanted to use this to detect where is user and user can manipulate address?

     

    Very weird and heartbreaking for me since I do not know how to configure this Google localisation and will have to stay with this and ask users that cannot provide good address to change to mobile.

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Elitezone :

    I guess that Google Maps uses IP addresses to get the user's location (I'm not sure).
    If so,you can try to create a cutom connector to get the user's location by using a specific API (returning the location through the user's IP).

    For example:

    http://pv.sohu.com/cityjson

    1.JPG

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 408

#3
timl Profile Picture

timl 339 Super User 2026 Season 1

Last 30 days Overall leaderboard