title: Jsonpath - Accessing array item using expression
body: <p>I am using AWS Step Functions which utilizes JSONPath for providing JSON paths. I have the following input :</p>
  
  <pre><code>{
      "response": {
        "isSuccess": true,
        "error": "",
        "body": {
          "count": 2,
          "fields": [
            {
              "fieldId": 1,
              "tabId": 100,
              "title": "First Name"
            },
            {
              "fieldId": 2,
              "tabId": 100,
              "title": "Last Name"
            }
          ]
        }
      },
      "iteration": {
        "totalCount": 2,
        "currentCount": 0,
        "step": 1
      }
    }
  </code></pre>
  
  <p>I want to query the fields array as:</p>
  
  <pre><code>$.response.body.fields[$.iteration.currentCount]
  </code></pre>
  
  <p>The value of currentCount is incremented by 1 as part of an iteration.
  I am getting an invalid XPath exception when trying to use the above.</p>
  
  <p>Can someone please advice on how to provide a dynamic property value to read array values?</p>