# How can I define a visualizer for a folder

**URL:** <https://community.postman.com/t/how-can-i-define-a-visualizer-for-a-folder/54982>\
**Category:** Help Hub\
**Tags:** visualizer\
**Created:** [November 24, 2023, 8:53pm UTC](https://community.postman.com/t/how-can-i-define-a-visualizer-for-a-folder/54982 "2023-11-24T20:53:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![helmutk](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@helmutk](https://community.postman.com/u/helmutk)\
**Post date:** [November 24, 2023, 8:53pm UTC](https://community.postman.com/t/how-can-i-define-a-visualizer-for-a-folder/54982/1 "2023-11-24T20:53:27Z")

</div>

Hi,

I have a set of tests, with the same response structure, stored in one folder.  
And each test uses the same visualizer “definition” like

> pm.visualizer.set( pm.variables.get(‘myVisualizerTemplate’), { response: pm.response.json() });

But it is very annoying to copy the same line in each test.

Can I define it per folder (e.g. via a central post-request-trigger script call?) that no duplicates are required anymore.

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:** [November 24, 2023, 10:05pm UTC](https://community.postman.com/t/how-can-i-define-a-visualizer-for-a-folder/54982/2 "2023-11-24T22:05:36Z")

</div>

Hey @helmutk 👋

You should be able to place that script at the Folder or the Collection level, it would then run after every request.

You would only need to have it in a single place and not repeated in every single request.

---

<div class="post-metadata">

**Author:** ![helmutk](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@helmutk](https://community.postman.com/u/helmutk)\
**Post date:** [November 25, 2023, 3:20pm UTC](https://community.postman.com/t/how-can-i-define-a-visualizer-for-a-folder/54982/3 "2023-11-25T15:20:10Z")

</div>

Thank you, you are right it is working and so simple if I call it in the “Tests” script (and not in the “Pre-request Script”, which I used until now)  
BR Helmut

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [November 28, 2023, 3:20pm UTC](https://community.postman.com/t/how-can-i-define-a-visualizer-for-a-folder/54982/4 "2023-11-28T15:20:29Z")

</div>

Closed on November 28, 2023, 3:20pm UTC

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