# Postman, i need help with response.json

**URL:** <https://community.postman.com/t/postman-i-need-help-with-response-json/40332>\
**Category:** Help Hub\
**Tags:** tests, variables, collections, help, json\
**Created:** [October 21, 2022, 8:34pm UTC](https://community.postman.com/t/postman-i-need-help-with-response-json/40332 "2022-10-21T20:34:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunogjvieira](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/brunogjvieira/32/13456_2.png) [@brunogjvieira](https://community.postman.com/u/brunogjvieira)\
**Post date:** [October 21, 2022, 8:34pm UTC](https://community.postman.com/t/postman-i-need-help-with-response-json/40332/1 "2022-10-21T20:34:45Z")

</div>

_My question_:  
Hi guys,  
how do I receive a response.json in the postman with only this answers “produto\_codigo\_tamanho” and “qtd”?  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/1/318da6d1b6f42ee7e6f4454b8995b86b5e63551d.png)

i just need response.json something like this to include in my workbench on postgres:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/4/1/41dc76531557d8dbac985580caac980729ea45f7.jpeg)

There must be a way?

_I’ve already tried_:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/3/f393562511f2fffbf4578e9ccc07cd2e1287f10b.png)  
but I just need “produto\_codigo\_tamanho” and “qtd” and this command returns all this:  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/6/9/69eda3042d027e8b648cfce3f9e7d0d08489ece4.png)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [October 24, 2022, 1:32pm UTC](https://community.postman.com/t/postman-i-need-help-with-response-json/40332/2 "2022-10-24T13:32:52Z")

</div>

JSON.parse and pm.response.json() creates a JavaScript object.

You can create a new object that just shows the two elements you are interested in using the JavaScript map function.

Something like.

```auto
// the following is a JavaScript object, and should be the same format as 
// var jsonData = pm.response.json();
var jsonData = {
    "stock": [
        {
            "produto_codigo_tamanho": "28899236",
            "qtd": "0",
            "cod_loja": "1",            
        },
        {
            "produto_codigo_tamanho": "28676534",
            "qtd": "1",
            "cod_loja": "1",            
        },
        {
            "produto_codigo_tamanho": "28906634",
            "qtd": "2",
            "cod_loja": "1",            
        }
    ]
}

var object = jsonData.stock.map(({ produto_codigo_tamanho, qtd }) => ({ produto_codigo_tamanho, qtd }));
console.log(object);

```

The results in the Console Log showing the 3 records but without cod\_loja

![image](https://us1.discourse-cdn.com/getpostman/original/3X/b/b/bb5c1b063a1b7e6a5c948bb1ba2d3531c24dc996.png)
