Question
WillisTowerWatson
US
Last activity: 17 Apr 2024 11:25 EDT
How to retrieve clipboard property in javascript text file
Hi,
I am trying to access clipboard property in a function inside a text file with js extension .I tried using JSP tags but it did not work .Do we have any other ways to get the clipboard property value .
Thanks.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 17 Apr 2024 11:25 EDT
Pegasystems Inc.
CA
Ensure these properties are also present in the UI since this is a client-side AP(getProperty)I. If you need something from the server side (only on the clipboard page), you can use safeURL to invoke activity in async mode and get the value.
pega.u.d.getProperty("pyWorkPage.PageName.PropertyName")—This will work only if your section rule displays this property in the UI while accessing it in the Javascript.
Bits in Glass
IN
@RashmithaM can you please try below url
https://support.pega.com/question/can-we-retrieve-value-clipboard-using-javascript-api
WillisTowerWatson
US
@Anoop Krishna, this Syntax work only in the Section, Controls but not in the text file with js extension.
Updated: 8 Apr 2024 12:41 EDT
Evoke Technologies
IN
You can use the below pega api to retrieve the clipboard property written in an JS file. We are using the below API long term and we aren't seeing any issues with it.
var propertyvalue = pega.u.d.getProperty("pyWorkPage.YourProperty");
console.log(propertyvalue);
Try the above code and check your console to verify if you are able to get the property value.
Note: If you are performing using a scripts in UI on a WorkObject from desktop, make sure you add your custom JS file on the Scripts Tab on the Perform Harness rule.
Let me know if this fixes your issue.
WillisTowerWatson
US
Thanks @Abhiveer Jatla will check and update you.
WillisTowerWatson
US
Hi @Abhiveer Jatla ,It did not work .It is giving me undefined value in the console. Please let me know if you need any other details .Thanks .
Evoke Technologies
IN
@RashmithaMif the properties are not present on the UI, add them as Hidden Content and on the action set, add the action event, On Change- Post Value.
this should work if your propery is not available on the UI but present on the clipboard. Let me know if this approach is working or not.
Accepted Solution
Updated: 17 Apr 2024 11:25 EDT
Pegasystems Inc.
CA
Ensure these properties are also present in the UI since this is a client-side AP(getProperty)I. If you need something from the server side (only on the clipboard page), you can use safeURL to invoke activity in async mode and get the value.
pega.u.d.getProperty("pyWorkPage.PageName.PropertyName")—This will work only if your section rule displays this property in the UI while accessing it in the Javascript.