# Copying response values to clipboard

**URL:** <https://community.postman.com/t/copying-response-values-to-clipboard/49376>\
**Category:** Help Hub\
**Created:** [July 10, 2023, 9:08am UTC](https://community.postman.com/t/copying-response-values-to-clipboard/49376 "2023-07-10T09:08:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlos-eduardo-corre](https://avatars.discourse-cdn.com/v4/letter/c/97f17d/32.png) [@carlos-eduardo-corre](https://community.postman.com/u/carlos-eduardo-corre)\
**Post date:** [July 10, 2023, 9:08am UTC](https://community.postman.com/t/copying-response-values-to-clipboard/49376/1 "2023-07-10T09:08:24Z")

</div>

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](https://stackoverflow.com/questions/67081665/how-do-you-copy-response-values-to-the-clipboard-in-postman-javascript-tests))

```auto
let template = `<html><body>
                <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.11/clipboard.min.js"></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>
                <script>
                    new ClipboardJS('#copyButton')
                        .on('success', function(e) {
                            e.clearSelection();
                        })
                        .on('error', function(e) {
                            e.clearSelection();
                            copyText.style.borderColor = 'red';
                        });
                    copyButton.click();
                </script>
            </body></html>`;

            pm.visualizer.set(template);

```

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!
