Hey Everyone!
I would love some help with this. I'm stuck. I have the following JSON.
- {
- "result":[
- {
- "bearing":-1,
- "currentStateDuration":"00:53:14",
- "exceptionEvents":[
- ],
- "isDeviceCommunicating":true,
- "isDriving":false,
- "latitude":34.9946861,
- "longitude":-106.659889,
- "speed":0.0,
- "dateTime":"2017-03-02T19:31:44.000Z",
- "device":{
- "id":"b1"
- },
- "driver":"UnknownDriverId",
- "groups":[
- {
- "children":[
- ],
- "id":"GroupCompanyId"
- }
- ]
- }
- ]
- }
All I would like to do is map the variables. I have tried, toMap, getJSON, JSONtolist etc. Any help would be great! Here is my current code:
- string GeoTabApi.get.DeviceStatusInfo(string message)
- {
-
- result = thisapp.GeoTabApi.call(input.message);
- resultJSON = result.getJSON("result");
- resultMap = resultJSON.toMap();
- lat = resultMap.get("latitude");
- info result;
- long = resultMap.get("longitude");
- GMapsURL = "http://maps.google.com/maps?z=12&t=m&q=loc:" + lat + "+" + long;
- return GMapsURL;
- }
Any help would be FANTASTIC! Thanks!