Visualize Nested JSON Response Body

Hey @michaelderekjones was wondering if you could assist me with this nested objects under “accounts” i.e. aid, account_id and the roles especially.

    "data": [
            "id": "123456987",
            "accounts": [
                    "aid": 1234,
                    "account_id": "987654321",
                    "roles": [
                    "granted_by": "9632587410",
                    "created": "1999-99-01T00:00:00.000Z",
                    "updated": "1999-99-01T00:00:00.000Z",
                    "auth0_connections": null,
                    "expiration": "0001-01-01T00:00:00Z"


If there is only one “id” in your response then the following should work.

let response = pm.response.json().data // parse response


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;position:sticky;top:0;}
        .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">


        {{#each response}}
            {{#each accounts}}



pm.visualizer.set(template, {
    response: response

If there is more than one ID, then a different approach may be needed.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.