0

I want to copy the text content displayed in Formula. Is there a way to do it? Thank you for your reply.

I want to copy the text content displayed in Formula. Is there a way to do it? Thank you for your reply.

 

4 replies

null
    • Alan_Cooke
    • 1 yr ago
    • Reported - view

    Create a formula field and place this in the OnClick.  Replace SERIAL with your fieldname and COPY SERIAL is the name of the button.

    html("<button onclick='copyToClipboard(""" + concat(SERIAL) +
    """)'>COPY SERIAL</button>
    <script>
    function copyToClipboard(str) {
    var el = document.createElement('textarea');
    el.value = str;
    el.setAttribute('readonly', '');
    el.style.position = 'absolute';
    el.style.left = '-9999px';
    document.body.appendChild(el);
    el.select();
    document.execCommand('copy');
    document.body.removeChild(el);
    }
    </script>")

      • gold_cat
      • 1 yr ago
      • Reported - view

        thanks Alan Cooke. 

      I tried this method, but it is strange that it works on my other database but not on this database.

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

       I made a mistake in my post - The script goes into the formula not on click.

      • gold_cat
      • 1 yr ago
      • Reported - view

        thanks Alan Cooke.   

      The code can copy simple letters and numbers, but it cannot copy my content that contains other symbols. I checked it.

Content aside

  • 1 yr agoLast active
  • 4Replies
  • 92Views
  • 2 Following