Unmask a Masked Field

IT9
Mega Contributor

Hello All,

I have a masked field under a RITM form which obtains testing password from users. Do you have any idea that I can unmask the value and send the password through an email notification?

find_real_file.png

Thanks very much for your help!

Queenie

5 REPLIES 5

Deepak Ingale1
Mega Sage

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);  

 

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.

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);
}

 

find_real_file.png

 

find_real_file.png

 

Deepak Ingale1
Mega Sage

Hi,

Please mark the reply as correct / helpful if it has solved your issue.