Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Unable to use function getDecryptedvalue in run script, Is there some plugin to be activated in dev instance to make this function work?

Satyasarat Pato
Tera Guru

Thanks in Advance.

In my dev instance , facing an error while using this Function getDecryptedvalue to decrypt a 2way encrypted password.

Let me know if there is any plugin needs to be activated.

1 ACCEPTED SOLUTION

Hi Chuck,



Thanks for the suggestion and i have tried this also before.



and not finally figured out that in function getDecryptedValue, V should be capital.



Thanks for your time.


View solution in original post

7 REPLIES 7

Satyasarat Pato
Tera Guru

Hi all,



This is the script i'm trying to execute in scoped application.



var password = (current.password).toString();


var decrypt = password.getDecryptedvalue();


workflow.scratchpad.password = (decrypt).toString();


Thank you. getDecryptedValue is not a string method, but a GlideElement method. When you used toString() you changed the type. The parenthesis don't seem to make much sense on line 1 either, by the way.



Try this:



var password = current.password;


var decrypt = password.getDecryptedvalue();


workflow.scratchpad.password = decrypt;



Reference: https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=SGE-getDecryptedValue


Hi Chuck,



Thanks for the suggestion and i have tried this also before.



and not finally figured out that in function getDecryptedValue, V should be capital.



Thanks for your time.