Skip to Content

How to get copy command after clicking on a link in sapui5?

Apr 12 at 09:39 AM


avatar image


I am working on SAPUI5. I have json data with three text fields. If I click on a link on table, it should copy JSON data. and we can paste it anywhere. How to do this in sapui5?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Irfan Gokak Apr 12 at 12:06 PM


Below code will work for you.

function myFunction() {
  var copyText = document.createElement("input");
  copyText.value = "Your text here";
  alert("Copied the text: " + copyText.value);
Show 2 Share
10 |10000 characters needed characters left characters exceeded

yeah. Thanku. its working now. I did some mistake that time


Thanks for tutorial ....

smile2.png (399 B)
Desiree Matas
Apr 12 at 10:44 AM

Hello Preety,

Could you provide us with some more details on what you are trying to do? Do you want to display data from a JSON model in a table, copy it to some other place? It is not clear from the description what you really want to do. The SAPUI5 version and controls you are using are also useful to help you.

Best regards,


Show 1 Share
10 |10000 characters needed characters left characters exceeded


I have a table. All the data in table is fetching through json. There is one field in table called copy link. If I click on link only particular data from JSON should copy, so that if I paste somewhere, the copied JSON data should come.