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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / MAP: Find a street add...
Power Apps
Unanswered

MAP: Find a street address using lat/long

(0) ShareShare
ReportReport
Posted on by 307

Is it possible to pass a lat/long to an address input control to find street addresses?

 

So, no user input, just click on the map, pass in the selected lat/long and return nearby addresses.

 

Or, omit the address input control is there a method to use lat/long to get neaby street addresses?

 

Categories:
I have the same question (0)
  • MudassarSZ365 Profile Picture
    591 on at

    Hi @STS1SS ,

    Yes, it is indeed possible to find a street address from a latitude and longitude
    Choose a Service that Offers Reverse Geocoding: Services like Bing Maps, Google Maps, and Azure Maps offer APIs for reverse geocoding.

    Set Up the API: Obtain an API key from your chosen service provider and understand the API limits and cost implications.

    PowerApps Integration: In PowerApps, you can use a custom connector or HTTP action in Power Automate to call the API service.

    Call the API: When a user clicks on a map or you otherwise obtain a latitude and longitude, make an API request to the reverse geocoding service, passing the latitude and longitude as parameters.

    For example, using Google Maps Geocoding API, an HTTP request to find an address would look like this:

    GET https://maps.googleapis.com/maps/api/geocode/json?latlng={latitude},{longitude}&key=YOUR_API_KEY

    Handle the Response: The API will return a JSON response with the address information. Parse this JSON to extract the street address and display it in your app.

    User Interface: In PowerApps, you might have a label or text input control where you can set the text property to the address returned by the API.

    Here's a conceptual example of setting up an API call within PowerApps:

    // Assume you have latitude and longitude in variables lat and long
    // Set up the API endpoint URL
    Set(apiURL, Concatenate("https://maps.googleapis.com/maps/api/geocode/json?latlng=", lat, ",", long, "&key=YOUR_API_KEY"));
    
    // Make the API call
    ClearCollect(collectedAddress, JSON(YourHTTPFunctionToCallAPI(apiURL),JSONFormat.IncludeBinaryData));
    
    // Now collectedAddress has the data returned by the API
    // You can extract the address from here and set it to a label's text property
    Set(address, First(collectedAddress).results[0].formatted_address);

     

  • STS1SS Profile Picture
    307 on at

    Thanks for the reply, but the Address Input TB doesn't have a text property, or an equivalent property, from what I can see. 

  • MudassarSZ365 Profile Picture
    591 on at

    @STS1SS ,

    Use a Label to Display the Address: After you get the address from the geocoding API, you could set it to a variable and then use a Label control to display it.

    // Call the API and store the response in a variable
    Set(addressResponse, YourFunctionToCallAPI(apiURL));
    
    // Assuming your response has the address in a property named 'formatted_address'
    Set(address, addressResponse.results[0].formatted_address);

    In the Label control:

    Text: address

    Use a Text Input to Display the Address: If you want to allow users to edit the address after it's been fetched, you can use a Text input control instead of a Label.

    In the Text input control:

    Default: address

    Kindly mark the solution as accepted if it resolves your issue.

    Best Regards
    Muhammad Mudassar Mazhar

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard