Visualizer not visualizing

My question:
My visualizer is not showing data as intended, I compared it to the brewery example and think I see the issue but not sure how to fix it.

Details:
In this screenshot you can see side by side the pm.visualizer code. And Json results
#1 is my test, it look like the Jason is an object that has a data level.
#2 is the Postman brewery example.

I’ve already tried:
Dot notations for the variable. Didn’t work and wasn’t surprised Not a js expert so not sure on how best to grab the data.

Hi @dxlmx

try .data on your ‘each’ statement, like this;

var template = `
    <style type="text/css">
        body: {background-color:#e0ffff;}
        h3: {color:#ffff00;}
    </style>
    
    <body>
    <h3>Tweets</h3>
        {{#each response.data}}   //<----- here
            
            <h5>{{id}}</h5>
            <p>{{text}}</p>

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

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

Example output;

1 Like

Thank you very much that worked!

1 Like