# Visualizer only works with handlebars?

**URL:** <https://community.postman.com/t/visualizer-only-works-with-handlebars/15096>\
**Category:** Help Hub\
**Tags:** javascript, visualizer\
**Created:** [August 18, 2020, 3:13am UTC](https://community.postman.com/t/visualizer-only-works-with-handlebars/15096 "2020-08-18T03:13:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexanderschriver](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/alexanderschriver/32/5296_2.png) [@alexanderschriver](https://community.postman.com/u/alexanderschriver)\
**Post date:** [August 18, 2020, 3:13am UTC](https://community.postman.com/t/visualizer-only-works-with-handlebars/15096/1 "2020-08-18T03:13:09Z")

</div>

Hey, I’m new to PM and very interested in the Visualizer feature, but I’m wondering - are templates only able to access/pass in data from a response with handlebars? Meaning, is there any way I can work with regular old Javascript to handle data/interpolate it into a template? For instance:

```
var template = `
          <div>{{myresponse.product}}</div>`
       `
    pm.visualizer.set(template, {
        myresponse: pm.response.json()
    })

```

Works fine - I see the value I expect, which is just the value of a property within the main response object.

However,

```
var template = `
            <div>${myresponse.product}</div>
            `

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

```

Give the error “myresponse” is not defined.

Wondering if anyone has an answer to this/basic tips on using regular JS instead of handlebars inside a template, or just in the visualizer at large (like, is a template required?) Thanks!!

---

<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:** [August 18, 2020, 6:20am UTC](https://community.postman.com/t/visualizer-only-works-with-handlebars/15096/2 "2020-08-18T06:20:21Z")

</div>

The only thing that’s required is `pm.visualizer.set(<template name>)` and the template name variable containing the data you want to render.

The data object (the 2nd argument) inside that `.set()` function is optional.

So you can display that value by refactoring what you have a little bit:

```auto
let myresponse = pm.response.json()

var template = `
            <div>${myresponse.product}</div>
            `
pm.visualizer.set(template)

```

That will render the value in the Visualize tab:

 ![Screenshot 2020-08-18 at 06.52.17](https://us1.discourse-cdn.com/getpostman/original/3X/5/d/5d720a2fa714018930286a6e95bd33950ac646be.png)

---

<div class="post-metadata">

**Author:** ![alexanderschriver](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/alexanderschriver/32/5296_2.png) [@alexanderschriver](https://community.postman.com/u/alexanderschriver)\
**Post date:** [August 19, 2020, 5:54pm UTC](https://community.postman.com/t/visualizer-only-works-with-handlebars/15096/3 "2020-08-19T17:54:22Z")

</div>

> [@danny-dainton](#):
>
> by refactori

Thanks so much! This is exactly the explanation I was looking for, I knew there had to be a simple way to achieve the basic idea I was looking for without the handlebars side of things… really appreciate it!
