# Table not showing data in visualizer, pls guide me

**URL:** <https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232>\
**Category:** Help Hub\
**Tags:** visualizer\
**Created:** [September 25, 2020, 11:09am UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232 "2020-09-25T11:09:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhaumik](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bhaumik](https://community.postman.com/u/Bhaumik)\
**Post date:** [September 25, 2020, 11:09am UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232/1 "2020-09-25T11:09:35Z")

</div>

Hi  
My json response is like below.

```auto
{
    "status": true,
    "status_code": 200,
    "data": {
        "first_name": {
            "result": "Match"
        },
        "middle_name": {
            "result": "Match"
        },
        "last_name": {
            "result": "Match"
        },
        "address": {
            "result": "Partial Match"
        },
        "city": {
            "result": "Match"
        },
        "state": {
            "result": "Match"
        },
        "zip": {
            "result": "Match"
        },
        "gender": {
            "result": "Match"
        },
        "dob": {
            "result": "Match"
        }
    },
    "transaction_id": "16010319055f6dcee18188eG0wfp",
    "request_id": "0000"
}

```

I wanted to see in the table at visualizer I have added below script in test tab but visualizer only shows headers of column.

```auto
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>Request Parameter</th>
            <th>Response</th>
        </tr>
        
        {{#each response.data.contacts}}
                <td id={{@key}}>{{first_name}}</td>
                <td>{{result}}</td>
                </tr>
        {{/each}}
    </table>
`;

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

```

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

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 25, 2020, 11:56am UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232/2 "2020-09-25T11:56:12Z")

</div>

Hey @Bhaumik,

This might be what you’re looking for:

```auto
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>Request Parameter</th>
            <th>Response</th>
        </tr>
        {{#each response.data}}
        <tr>
            <td>{{@key}}</td>
            <td>{{result}}</td>
        </tr>
        {{/each}}
    </table>
    
`;

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

```

> {{#each response.data.contacts}}

I suspect the `contacts` part was taken from something else as that’s not part of your response. Also `{{@key}}` would give you the name of the parameter but you would need to have that as the value and not in the `id` element tag.

 ![Screenshot 2020-09-25 at 12.56.54](https://us1.discourse-cdn.com/getpostman/original/3X/d/a/da30d44b2252f6edd4be3d48060f67481934294f.png)

---

<div class="post-metadata">

**Author:** ![Bhaumik](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bhaumik](https://community.postman.com/u/Bhaumik)\
**Post date:** [September 25, 2020, 11:59am UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232/3 "2020-09-25T11:59:38Z")

</div>

@dannydainton  
Thank you sir …!!! one last thing is it possible to show no matches/ partial matches in diff color just to highlight ?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 25, 2020, 1:06pm UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232/4 "2020-09-25T13:06:56Z")

</div>

Umm…yeah but it’s a little hacky without handlebar helpers. You could do this I guess.

```auto
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>Request Parameter</th>
            <th>Response</th>
        </tr>
        {{#each response.data}}
        <tr>
            <td>{{@key}}</td>
            <td id="{{@index}}_result">{{result}}</td>
        </tr>
        {{/each}}
    </table>
    
<script>
{{#each response.data}}
if("{{result}}" === "Match") {
    document.getElementById("{{@index}}_result").style.background = "green";
    document.getElementById("{{@index}}_result").style.color = "white";
}
else {
    document.getElementById("{{@index}}_result").style.background = "yellow";
}
{{/each}}
</script>
`;

```

Or for a slightly different table using [Bulma](https://bulma.io/)

```auto
var template = `

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css">
    
<body>
  <section class="section">
    <div class="container">
      <h1 class="title">Results</h1>
        <table class="table is-bordered is-striped is-hoverable is-fullwidth">
            <tr>
                <th class="is-uppercase">Request Parameter</th>
                <th class="is-uppercase">Response</th>
            </tr>
            {{#each response.data}}
            <tr>
                <td>{{@key}}</td>
                <td id="{{@index}}_result">{{result}}</td>
            </tr>
            {{/each}}
        </table>
    </div>
  </section>
</body>
<script>
{{#each response.data}}

"{{result}}" === "Match" ? (document.getElementById("{{@index}}_result").style.background = "green", document.getElementById("{{@index}}_result").style.color = "white" )
    : document.getElementById("{{@index}}_result").style.background = "yellow"

{{/each}}
</script>
`;

```

---

<div class="post-metadata">

**Author:** ![Bhaumik](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bhaumik](https://community.postman.com/u/Bhaumik)\
**Post date:** [September 25, 2020, 1:40pm UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232/5 "2020-09-25T13:40:35Z")

</div>

Thanks again for ur efforts  
seems real hacky indeed  
Tried both but it shows Can’t visualize the response.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 25, 2020, 1:55pm UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232/6 "2020-09-25T13:55:57Z")

</div>

Did you add this:

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

```

Those are just 2 different templates I posted, you also need that to actually visualize it 😃

---

<div class="post-metadata">

**Author:** ![Bhaumik](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bhaumik](https://community.postman.com/u/Bhaumik)\
**Post date:** [September 25, 2020, 2:05pm UTC](https://community.postman.com/t/table-not-showing-data-in-visualizer-pls-guide-me/16232/7 "2020-09-25T14:05:18Z")

</div>

HaHa My bad…!! yes both are working thanks.
