0

Copy the text content of a formula field with one click

Hello, I have a formula field that gives me a text result and I would like, when I click on this result, for the text to be copied to my clipboard so that I can paste it elsewhere.

Example: The formula field "myForm" displays the result "It's ok". When I click on the formula field "myForm", I would like "It's ok" to be automatically copied to my clipboard.

Is it possible? And if so, how?

Thank you for your help.

1 reply

null
    • Ninox developper
    • Jacques_TUR
    • yesterday
    • Reported - view

    Yes, this is possible using Ninext, which allows you to execute JavaScript and interact with the clipboard.
    The Ninext presentation app includes a global function called copyToClipboard that does exactly this:
    https://docs.ninext.fr/ninext-app-38
    In Ninox, a formula field doesn’t support click triggers natively, so the simplest approach is to add a button next to your formula field. In the button’s script, write:
    let textToCopy := myForm;
    copyToClipboard(textToCopy)
    You can name the button “📋 Copy” so the user knows what it does.

     

    ⚠️ Important note about browser security:
    Browsers only allow writing to the clipboard if the action is triggered directly and immediately by a user interaction (a click). This is actually perfect here, since the button click itself triggers the copy — so it works without any issue.
    However, if the text to copy involved a long async computation before calling copyToClipboard, the browser might block the clipboard write. In that case, the recommended approach would be to let the computation finish first, then ask the user to click a button to confirm the copy.
    Hope this helps!

Content aside

  • yesterdayLast active
  • 1Replies
  • 31Views
  • 2 Following