title: AWS Step Function - Adding dynamic value to Pass state type
body: <p>I have the following state defined in my state machine.</p>
  
  <pre><code> "loop":{
        "Type": "Pass",
        "Result":{
          "totalCount": "$.newFieldsResponse.body.count",
          "currentCount": 0,
          "step": 1
        },
        "ResultPath": "$.iteration",
        "Next":"iterateLoop"
      },
  </code></pre>
  
  <p>I expect the output of the state to be:</p>
  
  <pre><code>"newFieldsResponse": {
        "isSuccess": true,
        "error": "",
        "body": {
          "count": 2,
          "fields": [...]
        }
      },
      "iteration": {
        "totalCount": 5,
        "currentCount": 0,
        "step": 1
      }
    }
  </code></pre>
  
  <p>iteration property is added to the input with totalCount property to be set to count of items in fields array.</p>
  
  <p>However, the output for "iteration" property is set as:</p>
  
  <pre><code>"iteration": {
        "totalCount": "$.newFieldsResponse.body.count",
        "currentCount": 0,
        "step": 1
      }
  </code></pre>
  
  <p>It looks like the value "$.newFieldsResponse.body.count" is not getting resolved and is output as is.</p>
  
  <p>Is there something I am doing wrong ? Can someone please advice on how to make it work ?</p>