• Avatar
    Kunal Ramji

    You can do this by adding a script in your template sheet:

    function copyTextToClipboard(text) {
    var textArea = document.createElement("textarea");

    textArea.value = text;


    try {
    var successful = document.execCommand('copy');
    var msg = successful ? 'successful' : 'unsuccessful';
    console.log('Copying text command was ' + msg);
    } catch (err) {
    console.log('Oops, unable to copy');



    On the same template sheet, you can create your button:

    <center><button class="button" onclick="copyTextToClipboard('{{Header name of what you want to copy}}')">What you want it to say in your button</button></center>

    Credit goes to Edward McMillan who created this:

    Link to his spreadsheet:

    Comment actions Permalink
  • Avatar
    Randolph Abelardo

    Thanks for sharing @Edward's cool use case, @Kunal !

    Unfortunately, the script used doesn't support long characters and line breaks.

    @Sony, just to set your expectations correctly, please note that this topic is beyond Awesome Table's scope of support. But this is a community where everyone's encouraged to help each orher. If anyone can help Sony with his task, please do.

    - Randy

    Comment actions Permalink
  • Avatar

    hi, with regards to the copy clipboard function shared, just a few points:
    1. there is nothing wrong with the script. it works regardless of the length limit.

    2. the issue is that when there is/ are line break\s or carriage returrn, then it stopped working. this is a common issue across all javascript related to copy to clipboard function.

    3. what i did as a work around is to seperate multi lines clips into various clips and "reassemble" them later using say windows clipboard.

    hope this clarifies.

    Comment actions Permalink

Please sign in to leave a comment.