# Need help - How to set a variable for responses starting with \[ instead of {

**URL:** <https://community.postman.com/t/need-help-how-to-set-a-variable-for-responses-starting-with-instead-of/9453>\
**Category:** Help Hub\
**Created:** [December 5, 2019, 11:56pm UTC](https://community.postman.com/t/need-help-how-to-set-a-variable-for-responses-starting-with-instead-of/9453 "2019-12-05T23:56:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pushpender07](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@pushpender07](https://community.postman.com/u/pushpender07)\
**Post date:** [December 5, 2019, 11:56pm UTC](https://community.postman.com/t/need-help-how-to-set-a-variable-for-responses-starting-with-instead-of/9453/1 "2019-12-05T23:56:45Z")

</div>

hi all, I have a response structure like below  
[  
{  
“abc”: “123”,  
“number”: “ABC”  
},  
{  
“abc”: “1234”,  
“number”: “ABCD”  
}  
]  
I want to extract the first value and all the values of the field “number” from the response. Need some help on how to do it.

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [December 6, 2019, 4:25pm UTC](https://community.postman.com/t/need-help-how-to-set-a-variable-for-responses-starting-with-instead-of/9453/2 "2019-12-06T16:25:56Z")

</div>

Hi @pushpender07, welcome to the Postman community 🙂

You’ll need to assign this to a variable to be able to manipulate it using JavaScript.  
Here’s how you would print every number value in the console:

```auto
var content = [ 
   { 
      "abc":"123",
      "number":"ABC"
   },
   { 
      "abc":"1234",
      "number":"ABCD"
   }
]

for(i = 0; i < whatev.length; i++) { 
   console.log(whatev[i].number) 
}

```

To learn more about manipulating JSON arrays, you can refer to the MSDN documentation right here:

> **[Working with JSON - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON)**
>
> In this article, we've given you a simple guide to using JSON in your programs, including how to create and parse JSON, and how to access data locked inside it. In the next article, we'll begin looking at object-oriented JavaScript.

---

<div class="post-metadata">

**Author:** ![pushpender07](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@pushpender07](https://community.postman.com/u/pushpender07)\
**Post date:** [December 6, 2019, 6:58pm UTC](https://community.postman.com/t/need-help-how-to-set-a-variable-for-responses-starting-with-instead-of/9453/3 "2019-12-06T18:58:56Z")

</div>

Thank you, it worked.
