AnsweredAssumed Answered

How do I access the data from this json?

Question asked by jquinada on Apr 14, 2020
Latest reply on Apr 15, 2020 by jbarry-esristaff

I am trying to access the results of the following URL in my Javascript code. The result returned is a JSON, and I'm trying to get the x and y results of that JSON.


Here is the URL:


It would use GET which returns the following object:


I will actually have variables for the lat, long coordinates, but let's leave that hard-coded for the moment.


I have tried all sorts of methods of trying to grab the x and y results but nothing's worked. Currently I have an ajax call like this:

var lat, long, temp;
var url = "";
   dataType: 'json',
   type: "GET",
   url: url,
   success: function(jsonobject)
      temp = JSON.parse(jsonobject);
      lat = temp.geometries.x;
      long = temp.geometries.y;

I am not sure I am using the parse correctly, but looking at examples in various places online I'm not sure how else it should be done. When I try to run the code the only result I get is "undefined."


What am I missing?