Hi
My json response is like below.
{
"id": 2491,
"uid": "996db8cb-ee5c-473f-80f4-e2735f086133",
"name": "Raynor Schein",
"two_word_name": "Cal Efornia",
"four_word_name": "Maude L. T. Ford",
"name_with_initials": "Earl E. Byrd",
"name_with_middle": "Florene Mraz Gerlach DO",
"first_name": "Levi",
"middle_name": "Wehner",
"last_name": "Mertz",
"male_first_name": "Clay",
"female_first_name": "Chantel",
"prefix": "Mrs.",
"initials": "BCD"
}
I wanted to see in the table at visualizer I have added below script in test tab but visualizer only shows headers of column.
var template = `
.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;}
<table class="tftable" border="1">
<tr>
<th>ID</th>
<th>Name</th>
<th>Full Name</th>
<th>Initials</th>
</tr>
{{#each response}}
<tr>
<td>{{id}}</td>
<td>{{name}}</td>
<td>{{@four_word_name}}</td>
<td>{{initials}}</td>
</tr>
{{/each}}
</table>
`;
pm.visualizer.set(template, {
response: pm.response.json()
});