UiPath Form Designer - Button to copy in clipboard

Hi all,

I am using the Action Center with unattended robots.
I build several ‘Tasks’ with the UiPath Form Designer (activity Create Form Task).

To make life simpler for the users, I would like to create a button that saves some text/values in the clipboard.
Something like this:
Copy

<button onclick="copyText()">Copy</button>
<script>
    function copyText() {
      /* Copy text into clipboard */
      navigator.clipboard.writeText("Hello from clipboard");
    }
</script>

but that doesn’t work on the action center.
Any ideas? Workaround?

Best regards

I almost found a way. You should use a button component (not an HTML Element).

Create an Event In advanced logic, chose Javascript action, add this:

navigator.clipboard.writeText('test');

It should set ‘test’ in your clipboard
→ Works perfectly fine in the form designer.

But in the Action Center, brings an error

FormioUtils.js:57 An error occured within the custom function for Copy ReferenceError: navigator is not defined

seems it has no access. Any workaround?