2

I found article in the Appian-community which is over two years old (see Copy Text functionality) which states that it is not possible achieve what I want:

Is it possible to configure a feature as below: A button is displayed next to a Non-editable text field. On click of the button, the text must be copied into the clipboard and the user can paste it with a simple Ctrl+V (Windows)

Peter L. (Appian Employee) over 2 years ago in reply to soujanya B

I'm not aware of any action in Appian you can take that would copy to the clipboard other than the standard CTRL + C. [...]

I am still optimistic that there might be a clever workaround since the demanded functionality is simple JS functionality. That's also the reason I am asking here and not inside the Appian Community.

function myFunction() {
  /* Get the text field */
  var copyText = document.getElementById("myInput");

  /* Select the text field */
  copyText.select();
  copyText.setSelectionRange(0, 99999); /* For mobile devices */

   /* Copy the text inside the text field */
  navigator.clipboard.writeText(copyText.value);

  /* Alert the copied text */
  alert("Copied the text: " + copyText.value);
} 
 <!-- The text field -->
<input type="text" value="Hello World" id="myInput">

<!-- The button used to copy the text -->
<button onclick="myFunction()">Copy text</button> 

Further reading:

B--rian
  • 5,578
  • 10
  • 38
  • 89
  • 1
    I don't see how you could do it without developping your own plugin... – J. Chomel Jun 02 '22 at 06:51
  • @J.Chomel I would love to contribute if I knew where to start. – B--rian Jun 02 '22 at 08:56
  • Myself still not expert, but it looks like you could start from somewhere like https://docs.appian.com/suite/help/22.1/component-plugins.html – J. Chomel Jun 02 '22 at 11:48
  • Deploy your JS code along with button to some custom page and then use Web Content Component to show this button on your Appian ui. Let me know whether it will work. https://docs.appian.com/suite/help/22.1/Web_Content_Component.html – Jakub Aug 04 '22 at 19:52

0 Answers0