List of values from a JSON array

Hi all,
Im trying to get a simple JSON array key and values returned as a list. Basically showing date/time and the related tide values as list items.
In my day plan Shortcut, I would like to add basic tidal information like this:
Date time: “time value” - “tide value”
The JSON reply looks like this:

{
  "metadata": {
    "latitude": -36.731,
    "longitude": 174.556,
    "datum": "LAT",
    "start": "2021-01-31T11:00:00.000Z",
    "days": 2,
    "interval": 0,
    "height": "LAT = 1.704m below MSL"
  },
  "values": [
    {
      "time": "2021-01-31T15:32:00Z",
      "value": 0.35
    },
    {
      "time": "2021-01-31T21:51:00Z",
      "value": 3.09
    },
    {
      "time": "2021-02-01T04:04:00Z",
      "value": 0.46
    },
    {
      "time": "2021-02-01T10:09:00Z",
      "value": 2.92
    },
    {
      "time": "2021-02-01T16:19:00Z",
      "value": 0.35
    },
    {
      "time": "2021-02-01T22:37:00Z",
      "value": 3.1
    },
    {
      "time": "2021-02-02T04:52:00Z",
      "value": 0.43
    },
    {
      "time": "2021-02-02T10:59:00Z",
      "value": 2.92
    }
  ]
}

Any help would be greatly appreciated!

Here’s an example that may help you. Let me know if any questions — jay

https://www.icloud.com/shortcuts/c4661f6ae08b4214921ffe04fafa5dbc

1 Like

Hi Jay

Thank you! - The bit I missed was to set the Repeat Items as Dictionary and then get the values.

Hi, your return json can be fetched as dictionary in a variable ‘x’. From this variable ‘x’ get the key ‘values’ as another dictionary in a variable ‘y’