Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Knowledge Expert
FR
Last activity: 30 Nov 2018 1:44 EST
Get value from Clipboard from JavaScript
How to get a value from Clipboard in JS text file? There is an API for setValue, but how to read that value back after setting?
Take into account that this is not a Section or Control rule - just JS text file. So looks like I cannot use <pega:reference> and <%=> tags there since those are for JSP only.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](https://accounts.pega.com/sites/default/files/pega-user-image/399/REG-398680.png?source=PUMINIT)
![](https://accounts.pega.com/sites/default/files/pega-user-image/399/REG-398680.png?source=PUMINIT)
Pegasystems Inc.
IN
This might be helpful
https://collaborate.pega.com/question/can-we-retrieve-value-clipboard-using-javascript-api
-
Pradeep Yarlagadda Mateusz Sak Matt Geiger Gaurav Kumar Guangri Liang and 1 More
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Knowledge Expert
FR
No, have you even read the post? Just replying with links without getting into the topic would never help.
-
Jai Siva Naga Babu Kona Julio Castilla Samer Hamadeh Kaushik Dutta
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690909000/8dfb0f74-e315-4967-972d-0f66a49623e2.jpg?itok=R2OJJgh0)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690909000/8dfb0f74-e315-4967-972d-0f66a49623e2.jpg?itok=R2OJJgh0)
Amazon
IN
Event i am trying to search for the same, but could not get any useful links for getting property value directly in JS file without using JSP.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689977000/ca5d61dc-47bd-406c-8ea6-9d6a790a4f7e.jpg?itok=O3xagdnP)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689977000/ca5d61dc-47bd-406c-8ea6-9d6a790a4f7e.jpg?itok=O3xagdnP)
Pegasystems Inc.
IN
Did you try using "pega.u.d.getProperty"?
-
Victor Talukdar Bruno Oliveira pravalika kamisetti
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690909000/8dfb0f74-e315-4967-972d-0f66a49623e2.jpg?itok=R2OJJgh0)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690909000/8dfb0f74-e315-4967-972d-0f66a49623e2.jpg?itok=R2OJJgh0)
Amazon
IN
Hi Pankaj,
Could you please provide an example for the same
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689977000/ca5d61dc-47bd-406c-8ea6-9d6a790a4f7e.jpg?itok=O3xagdnP)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689977000/ca5d61dc-47bd-406c-8ea6-9d6a790a4f7e.jpg?itok=O3xagdnP)
Pegasystems Inc.
IN
var propValue = pega.u.d.getProperty("propertyName");
var propValue = pega.u.d.getProperty("propertyName", "pageName");
Just make sure these properties are present in the UI also since this is a client side api. If you need something from server side (which is only on clipboard page) you can use safeURL to invoke activity in async mode and get the value.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-06/de4f8957-75c3-49a0-ab1a-3094a8db9dec.jpeg?h=43272360&itok=Y1n0Miqk)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-06/de4f8957-75c3-49a0-ab1a-3094a8db9dec.jpeg?h=43272360&itok=Y1n0Miqk)
Pegasystems Inc.
PL
just as some addition - there's "hidden" control available to handle such use cases. You need to have this property exposed in UI - if you don't need it to show up in your UI, this is the best approach to use.
-
Mounika Chenna
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689972000/77a81565-a581-4249-8bb6-58a534c43f1c.jpg?itok=wPvpAhBY)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689972000/77a81565-a581-4249-8bb6-58a534c43f1c.jpg?itok=wPvpAhBY)
Pegasystems Inc.
US
Another option would be to consider running an activity to retrieve the property value. If you want to try that and see if that helps.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-06/de4f8957-75c3-49a0-ab1a-3094a8db9dec.jpeg?h=43272360&itok=Y1n0Miqk)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-06/de4f8957-75c3-49a0-ab1a-3094a8db9dec.jpeg?h=43272360&itok=Y1n0Miqk)
Pegasystems Inc.
PL
Please note, in this case you need request to server, what's more this property will be fetched from Clipboard. In case of client-side changes of this property they could have different value on server (until you submit the form).