# How to filter and view the request response from just one of the columns in the json structure?

**URL:** <https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723>\
**Category:** Help Hub\
**Tags:** visualizer\
**Created:** [June 20, 2023, 9:59am UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723 "2023-06-20T09:59:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![descent-module-engi9](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@descent-module-engi9](https://community.postman.com/u/descent-module-engi9)\
**Post date:** [June 20, 2023, 9:59am UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/1 "2023-06-20T09:59:37Z")

</div>

I have a request that returns a JSON structure with two columns. I’d like to separate and view only the left column, but I can’t find a way to do that.

 ![postman_visualizer](https://us1.discourse-cdn.com/getpostman/original/3X/8/e/8ecfc27b9f29d8e5db40d89be8555ce0d1c2dcf7.png)

I would very much like to do so, but so far all my efforts are without result. It would be incredibly helpful if that were possible.

---

<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:** [June 20, 2023, 12:48pm UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/2 "2023-06-20T12:48:20Z")

</div>

Your JSON response is an array of objects.

The columns you are talking within the objects are key\value pairs.

As your response appears to be a flat array, to return just the keys you can use the JavaScript object.keys function.

```auto
const response = pm.response.json();

console.log(Object.keys(response));

```

---

<div class="post-metadata">

**Author:** ![descent-module-engi9](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@descent-module-engi9](https://community.postman.com/u/descent-module-engi9)\
**Post date:** [June 23, 2023, 6:52pm UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/3 "2023-06-23T18:52:45Z")

</div>

Olá!! Obrigado pelo o apoio, mas essa essa função não funciona, já fiz algumas tentativas. É como se ele não encontrasse. Note que tem um número como label e outro numero como dado. Ex: “0.8866666666666667” : 0.11333333333333333. Estou em busca de algo que extraia somente o número como dado.

---

<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:** [June 26, 2023, 9:34am UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/4 "2023-06-26T09:34:38Z")

</div>

I don’t speak Portuguese, so I had to run that through a translator.

In your original post, you said you wanted the left most column, which would be the key.

Do you mean you want the values, not the keys?

For example, in the first object you want the 0.1133333333xxx value? (Not the 0.886666666xxx).

Do you want the value for the first object only, or do you want a list of all of the values?

---

<div class="post-metadata">

**Author:** ![descent-module-engi9](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@descent-module-engi9](https://community.postman.com/u/descent-module-engi9)\
**Post date:** [June 26, 2023, 7:56pm UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/5 "2023-06-26T19:56:14Z")

</div>

Hello !! I do not speak English too. We draw… hehehe. I’m glad for your support. Achieving some advances, but now it’s time to turn the API response into a graph. Below is the response data. If you can help, thank you in advance.  
{“diab\_t1”:[[0.93,0.07]],  
“diab\_t2”:[[0.91,0.09]],  
“cardio\_stroke”:[[0.95,0.05]],  
“cardio\_dac”:[[0.92,0.08]],  
“asthma”:[[0.87,0.13]],  
“dpoc”:[[0.92,0.08]]}

---

<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:** [June 27, 2023, 11:19am UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/6 "2023-06-27T11:19:06Z")

</div>

Do you want a graph or a table?

If its a graph, what type of graph, and how should it look.

Your response seems to have a number of “conditions”. Diabetes, Stroke, Asthma, etc.

For each of those conditions. You have an array within an array. (Is that actually correct because that is going to complicate things).

Within the innermost array, there are two sets of numbers (readings?) for each condition. What do those numbers represent?

I could probably create a table, with the headings “Condition, Max Reading, Min Reading” or something similar.

If you actually want a graph, you will need to explain a bit more about how it should look.

---

<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:** [June 27, 2023, 12:00pm UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/7 "2023-06-27T12:00:40Z")

</div>

This is a basic example of producing a table in the visualizer.

As your JSON is pretty flat, its not easy to target the elements, so I had to use {{@key}} and {{this}} to loop through the response.

If you want the readings split, then I would probably loop through the response first and create a new array with the name of the condition, and the two readings as that would then be easier to visualize. Rather than trying to write HTML code to deal with the formatting.

```auto
const response = pm.response.json();

var template = `

    <style type="text/css">
        .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}
        .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}
        .tftable tr {background-color:#ffffff;}
        .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}
        .tftable tr:hover {background-color:#e0ffff;}
    </style>
    
    <table class="tftable" border="1">
        <tr>
            <th>Condition</th>
            <th>Readings</th>
        </tr>
        
        {{#each response}}
            <tr>
                <td>{{@key}}</td>
                <td>{{this}}</td>
            </tr>
        {{/each}}
    </table>

`;

pm.visualizer.set(template, {
    response: response
});

```

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/5/95e628e7eb44b8c673488af73bd3fb1b23d84575.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:** [June 28, 2023, 11:34am UTC](https://community.postman.com/t/how-to-filter-and-view-the-request-response-from-just-one-of-the-columns-in-the-json-structure/48723/8 "2023-06-28T11:34:12Z")

</div>

I did think about splitting the readings using the array indexes, and the following appears to work.

```auto
const response = pm.response.json().data

var template = `

    <style type="text/css">
        .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}
        .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}
        .tftable tr {background-color:#ffffff;}
        .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}
        .tftable tr:hover {background-color:#e0ffff;}
    </style>
    
    <table class="tftable" border="1">
        <tr>
            <th>Condition</th>
            <th>High Reading</th>
            <th>Low Reading</th>
        </tr>
        
        {{#each response}}
            <tr>
                <td>{{@key}}</td>
                {{#each this}}
                    <td>{{[0]}}</td>
                    <td>{{[1]}}</td>
                {{/each}}
            </tr>
        {{/each}}
    </table>

`;

pm.visualizer.set(template, {
    response: response
});

```

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