Title: First element from array in Step functions Pass state
Tags: amazon-web-services;aws-step-functions
Question: I have this strange problem with AWS step functions Pass state.
I currently send the following JSON to a Pass state
```[
  [
    {
      &quot;key&quot;: &quot;value&quot;
    }
  ]
]
```
I need to remove the top array and send only the array and object to the next step.
```      [
        {
          &quot;key&quot;: &quot;value&quot;
        }
      ]
```
When I try with ```ResultPath: &quot;$[0]``` it is added an extra array on top instead.
When I try with ```Params: { &quot;$&quot;: &quot;$[0]&quot; }``` it considers the following as static input and prints as is.
Is there a way I can achieve the desired output? Any help is appreciated. Thanks.



Here is another answer: Thanks for your question.
The OutputPath field can be used here to filter your JSON. It allows you to select a specific part of your output, and pass only that data on to the next state. The ResultPath field is used to specify the path in the input to write your output. Since you specified &quot;$[0]&quot;, your output was written to index 0 of an array.
We understand these fields can be quite tricky to become familiar with, and we are working on some new ways to help smooth out this process for our customers!


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:12/02/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<amazon-web-services><aws-step-functions>', 'Title': 'First element from array in Step functions Pass state', 'ViewCount': 1267, 'id': 65108748, 'user_AboutMe': '<p>Javascript Enthusiast. Technical Lead by profession. Exploring DevOps.</p>\n', 'user_AccountId': 8120591.0, 'user_DisplayName': 'Himakar', 'user_Reputation': 185.0, 'user_Views': 25.0, 'user_id': 6117496.0}}