Unmask a Masked Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 07:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 10:43 PM
If it is a variable with type of MASK, you can simply do it using
var pass = current.variables.nameOfVariable
If it is Password 1 type field, then it is one way encryption which can not be decrypted.
If it is Password 2, it can be decrypted using servicenow API
var Encrypter = new GlideEncrypter();
var encrypted = current.variables.nameOfVariable;
var decrypted = Encrypter.decrypt(encrypted);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 11:38 PM
Thanks Deepak.
I've tried but seems no luck. My masked variable is a "service catalog variable", I don't think there is a password 1/2 option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2018 08:42 AM
Hi,
I have created a variable of type MASKED, named it as "v_masked"
I have set the value of it as "HelloWorld".
Executed below background script and it has given the value.
Meaning, masked field value can be accessed from Server side code.
Could you please share the script your are trying?
var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id", 'a1d3da60130d53488c72d7028144b07d');
gr.query();
if (gr.next()){
gs.print(gr.variables.v_masked);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2018 10:15 PM
Hi,
Please mark the reply as correct / helpful if it has solved your issue.