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?
@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
Thanks for the reply, but the Address Input TB doesn't have a text property, or an equivalent property, from what I can see.
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);
WarrenBelz
44
Most Valuable Professional
mmbr1606
41
Super User 2025 Season 1
MS.Ragavendar
36