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 Platform Community / Forums / Power Apps / Able to return Lat & L...
Power Apps
Unanswered

Able to return Lat & Long via JSON, but how do I parse into my fields instead of opening a new page?

(0) ShareShare
ReportReport
Posted on by 106

So I have the following code on a button that returns JSON location information from the MapQuest API depending on the location the user entered in the input.

 

UpdateContext({locURL: "https://www.mapquestapi.com/geocoding/v1/address?key=#############&inFormat=kvp&outFormat=json&location=" & dcTxtSupportLoc.Text & "&thumbMaps=false"}); 
Launch(locURL);

 

 ...and here an example of the returned JSON from the user entering "Chicago"...

 

{"info":{"statuscode":0,"copyright":{"text":"\u00A9 2021 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"\u00A9 2021 MapQuest, Inc."},"messages":[]},"options":{"maxResults":-1,"thumbMaps":false,"ignoreLatLngInput":false},"results":[{"providedLocation":{"location":"Chicago"},"locations":[{"street":"","adminArea6":"","adminArea6Type":"Neighborhood","adminArea5":"Chicago","adminArea5Type":"City","adminArea4":"Cook County","adminArea4Type":"County","adminArea3":"IL","adminArea3Type":"State","adminArea1":"US","adminArea1Type":"Country","postalCode":"","geocodeQualityCode":"A5XAX","geocodeQuality":"CITY","dragPoint":false,"sideOfStreet":"N","linkId":"282039507","unknownInput":"","type":"s","latLng":{"lat":41.883229,"lng":-87.632398},"displayLatLng":{"lat":41.883229,"lng":-87.632398}},{"street":"","adminArea6":"","adminArea6Type":"Neighborhood","adminArea5":"Chicago","adminArea5Type":"City","adminArea4":"Kenosha County","adminArea4Type":"County","adminArea3":"WI","adminArea3Type":"State","adminArea1":"US","adminArea1Type":"Country","postalCode":"","geocodeQualityCode":"A5XAX","geocodeQuality":"CITY","dragPoint":false,"sideOfStreet":"N","linkId":"283441957","unknownInput":"","type":"s","latLng":{"lat":42.586102,"lng":-87.824699},"displayLatLng":{"lat":42.586102,"lng":-87.824699}},{"street":"","adminArea6":"","adminArea6Type":"Neighborhood","adminArea5":"Chicago","adminArea5Type":"City","adminArea4":"Stutsman County","adminArea4Type":"County","adminArea3":"ND","adminArea3Type":"State","adminArea1":"US","adminArea1Type":"Country","postalCode":"","geocodeQualityCode":"A5XAX","geocodeQuality":"CITY","dragPoint":false,"sideOfStreet":"N","linkId":"364500464","unknownInput":"","type":"s","latLng":{"lat":46.862755,"lng":-99.237015},"displayLatLng":{"lat":46.862755,"lng":-99.237015}},{"street":"","adminArea6":"","adminArea6Type":"Neighborhood","adminArea5":"Chicago","adminArea5Type":"City","adminArea4":"Douglas County","adminArea4Type":"County","adminArea3":"NE","adminArea3Type":"State","adminArea1":"US","adminArea1Type":"Country","postalCode":"","geocodeQualityCode":"A5XAX","geocodeQuality":"CITY","dragPoint":false,"sideOfStreet":"N","linkId":"364485283","unknownInput":"","type":"s","latLng":{"lat":41.24382,"lng":-96.23311},"displayLatLng":{"lat":41.24382,"lng":-96.23311}}]}]}

 

.

..Ok all is good so far, except that the button opens a new tab with the JSON in it when I really just want to get the Lat & Long from the JSON to populate two fields on my form. 

Kevin00_0-1614986411384.png

 

Anyone have ideas on how to do this?

Categories:

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard