AWS Step Functions - Arrays

Viewed 13

Given the following, I would like to know how I can access the 'exists' field. I thought it was simply $.result.exists or $.result[0].exists but neither of these work? Also is there a way I can extract all occurrences of 'exists' from the array and use them in a choice flow using Step Functions?

[
  {
    "result": {
      "exists": true
    },
    "StatusCode": 200
  },
  {
    "result": {
      "exists": true
    },
    "StatusCode": 200
  }
]

Even better I would like to transform the following input:

  "output": [
    [
      {
        "result": {
          "exists": true
        },
        "StatusCode": 200
      },
      {
        "result": {
          "exists": true
        },
        "StatusCode": 200
      }
    ],
    {
      "result": {
        "exists": true
      },
      "StatusCode": 200
    }
  ]

into the following one array:

    [
      {
        "result": {
          "exists": true
        },
        "StatusCode": 200
      },
      {
        "result": {
          "exists": true
        },
        "StatusCode": 200
      }
    {
      "result": {
        "exists": true
      },
      "StatusCode": 200
    }
  ]

Is this possible? Any suggestions welcome!

0 Answers
Related