Polling external web site for JSON error geoevent 10.4.1

785
1
02-16-2017 09:31 AM
wadsonmakari
New Contributor III

Dear all,

I am polling an external website that is returning json example shown below

{
  "terminalLocationList": {
    "terminalLocation": [
      {
        "address": "some value",
        "currentLocation": {
          "accuracy": -1,
          "latitude": 51.24624,
          "longitude": -1.10018,
          "emergency": false,
          "timestamp": "2017-02-16T13:35:25.000Z"
        },
        "locationRetrievalStatus": "Retrieved"
      }
    ]
  }
}

the terminalLocation attribute is an array of objects.

Does anyone know what syntax I can use to get to the latitude and longitude values when setting up the X geometry field and the Y geometry fields in ESRI GEP

I have tried

      terminalLocationList.terminalLocation.currentLocation.longitude

      terminalLocationList.terminalLocation.currentLocation.latitude respectively

but I keep get errors in the logs

"Json parser could not find the field 'terminalLocationList.terminalLocation.currentLocation.longitude' in the incoming data. This field is needed to populate the 'x' value in the Geometry."

Is this the correct syntax to get to the long/lat fields?

Any ideas welcome.

0 Kudos
1 Reply
MarkBramer
Occasional Contributor II

Because terminalLocation is an array, try this:

terminalLocationList.terminalLocation[0].currentLocation.longitude

0 Kudos