Encrypting/Masking Variables in a Catalog Form (Integer field and String Field)

shahid1
Kilo Expert

Hi All,

We have a requirement here to make two of the catalog fields, in a form, encrypted/masked. (Basically the client wants us to make the fields look like a password field where and when user types in the text or integer it comes up in "*****" format or hidden format).

So , how to do that for a variable type string (Text Box) or Integer field? Anybody can help here?

Will that appear in the same way in the RITM form and TASK form?

And what will be the process to decry-pt or unmask it?

Thanks in Advance,

Shahid

23 REPLIES 23

rahulpandey
Kilo Sage

I suggest on Catalog you encrypt the value of those two fields "Password (2 way encrypted)"


and while mapping fields to RITM (It depends how you map it), you could use below


var Encrypter = new GlideEncrypter();    


var variable_value1 = Encrypter.decrypt(current.variables.variable_name1);  


var variable_value2 = Encrypter.decrypt(current.variables.variable_name2);   \


Now you will have decrypted value of variables


hope this will help little bit


Hi Rahul,



Thanks for the fast reply.



Can you let me know where i can select that option of "Password (2 way encrypted)"?(Are you talking about the system property?)



And what about the scripting? In case i dont want to encrpt the info in the task or ritm level rather encrypt it through a checkbox or something?



RGDS,


Shahid


Hi Shahid,



I am talking about variable type type "Masked". However if you do not wan't to encrypt it, "do not select the user encrypt".


Further to your question about decryption(you mentioned encryption), I think you can do it using UI action(A button). below link will surely help :-


Variable Types - ServiceNow Wiki


HI Rahul,



I am aware of that format called masked variable but i am not able to see that option under "type", when i am trying to select the type of that field.



I am using the Eureka version. Is it the reason the Masked option is not available?   As i saw that it is available in Fuji.


One.jpg


two.jpg


RGDS,


Shahid