For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
HomeDocs
HomeDocs
      • Overview
        • Overview
        • Write pre-request scripts
        • Write tests
        • Script examples
        • Dynamic variables
          • Overview
          • pm variables methods
          • pm.vault
          • pm.cookies
          • pm.request
          • pm.response
          • pm.sendrequest
          • pm.visualizer
          • pm.test and pm.expect
          • pm.require
          • pm.execution
          • pm.message
          • pm.info
          • pm.mock
          • pm.datasets
          • pm.state
        • Troubleshoot test errors
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

On this page
  • pm.visualizer
  • pm.getData
Tests and scriptsWrite scriptsPostman sandbox reference

Script Postman visualizations

||View as Markdown|
Was this page helpful?
Previous

Use scripts to send requests in Postman

Next

Writing tests and assertions in scripts

Built with

You can use the pm.visualizer object and the pm.getData method to visually represent your API’s request responses with the Postman Visualizer.

pm.visualizer

Use the pm.visualizer.set method to specify a template you want to use to display response data in the Postman Visualizer:

1pm.visualizer.set(layout:String, data:Object, options:Object):Function

This method uses the following properties:

  • layout - (Required) A Handlebars HTML template string.
  • data - A JSON object that binds to the template. You can access it inside the template string.
  • options - An Options object for Handlebars.compile().

Example:

1var template = `<p>{{res.info}}</p>`;
2pm.visualizer.set(template, {
3 res: pm.response.json()
4});

pm.getData

Use the pm.getData method to get response data inside a Postman Visualizer template string.

1pm.getData(callback):Function

The callback function accepts the following parameters:

  • error - Any error detail.
  • data - Data passed to the template by the pm.visualizer.set method.

Example:

1pm.getData(function (error, data) {
2 var value = data.res.info;
3});