Copying response values to clipboard

In an attempt to fully optimize the requests Iā€™m running I looked into ways to copy certain response values into the clipboard for easier access (no need to manually select and ctrl+V on the console logs).

At first it seemed like it was not possible but then I found a topic with a workaround. (testing - How do you copy response values to the clipboard in Postman javascript tests? - Stack Overflow)

let template = `<html><body>
                <script src=""></script>
                <code style="width:max-content!important;padding:10px;display:block;" id="copyText">${jsonData.backgroundProcessId}</code>
                <button id="copyButton" type="button" data-clipboard-action="copy" data-clipboard-target="#copyText" style="background:green;color:white;">Copy to Clipboard</button>
                    new ClipboardJS('#copyButton')
                        .on('success', function(e) {
                        .on('error', function(e) {
                   = 'red';


The above block of code does indeed allow automatic copying to clipboard but it requires me to access the visualize tab. Problem is, Iā€™m running various requests in a collection which (to my knowledge) does not open the visualize tab at any point.

Is there anyway to make the collection runner open the visualize tab of a specific request? Or a different way to copy response values to the clipboard automatically?

Thank you for any help!