Forum Discussion

DanielJohnson2's avatar
DanielJohnson2
Qrew Trainee
4 years ago

Copy Text Field to Clipboard

Hi All,

I'm trying to add a new button that would copy the text of a field to my clipboard. I've seen posts about this from the past, but they all use JavaScript, and I get the "Only text, Quickbase-accepted functions, fields, variables, and certain HTML tags are allowed in this field. JavaScript is not supported" error when I try saving.

Does anyone know how to do this today?

Thanks,

------------------------------
Daniel Johnson
------------------------------
  • Hoping to give this a bump. Is anyone doing this today?

    ------------------------------
    Daniel Johnson
    ------------------------------
  • I have one idea how to do that.

    ------------------------------
    Alex Priadko
    Senior Full Stack Developer (Php, React.js, Vue.js, Blockchain)
    Quickbase app builder too :)
    Email: mr.eskrano@gmail.com
    ------------------------------
    • AnthonyGuillen1's avatar
      AnthonyGuillen1
      Qrew Cadet

      I was looking for this solution, so that I could quickly copy the value of a field into clipboard, to then paste into a procurement system during data entry. This solution from the Code Page Samples worked perfectly.

      For others who, like me, may not be very skilled at these kinds of things, here's some additional steps. Took me a while to figure out, so maybe this will save someone some time:

      The code linked by Nicodemus (https://resources.quickbase.com/db/bq8meiyhh?a=dr&key=22) utilizes javascript, which can still be used in QuickBase in "code pages." 

      1. Go to your app's "Home" and click on settings icon.
      2. Go to Pages > + New Page > Code Page
      3. "Page Name" should be as the code page sample advises, "CopyText.html"
      4. Copy-Paste the sample code directly into the page, no modifications needed
      5. Save and make note of the "Page ID" of this new page
      6. Go to the table in the app where you want the Copy Button
      7. Create a new field of type Formula -URL
      8. Paste in the Formula URL from the sample code
      9. You only need to change two things in the formula: 1) The page ID to match your code page's ID, and 2) Replace [text] in URLEncode([Text]) with the actual field you want to copy
      10. Change Link text to something short like "Copy" or "To Clipboard"
      11. Change Open Target to In popup.
      12. Place the field wherever you want it, in a form or a report

      When you first try to use the button, your browser may ask for permission to access the clipboard. Say yes, and that's it!



      ------------------------------
      Anthony Guillen
      ------------------------------
      • SanketShah's avatar
        SanketShah
        Qrew Member

        Thank You @Anthony Guillen for the detailed explanation, this worked for me! 



        ------------------------------
        Sanket Shah
        ------------------------------
    • LB's avatar
      LB
      Qrew Cadet

      What if you need to copy more than one field to the clipboard? how do I add that to the formula?

      • Huh?  Inherently when you copy to clipboard it just copies one thing right?  If you wanted to copy two fields you'd have to make a formula text field which would combine those two fields.