Question
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!
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
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
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.
Pegasystems Inc.
IN
Did you try using "pega.u.d.getProperty"?
-
Victor Talukdar Bruno Oliveira pravalika kamisetti
Amazon
IN
Hi Pankaj,
Could you please provide an example for the same
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.
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
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.
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).