How to mask a field on form

Nitesh Chandana
Kilo Expert

Hello,

  I need to mask field on the form as we mask on record producer by using mask type. I doesn't want to use password type.

Can anyone help me out??

Thanks,

Nitesh

1 ACCEPTED SOLUTION

Hello Nitesh,



From Istanbul and Jakarta version, If you use a password(encrypted type 2). it will automatically mask the field on service portal. there by you can decrypt that by the following code:



var Encrypter = new GlideEncrypter();


var encrypted = current.variable name;


var decrypted = Encrypter.decrypt(encrypted);


current.u_client_instance_password = decrypted;


current.update();


View solution in original post

10 REPLIES 10

Thanks Vipul,


Its working as expected on form. Is there any way to work as same as form on service portal? Field should be masked on service portal page also,


There is an option on the client script form - UI Type. Please select All to run this script on mobile, desktop, service portal.


Yes i selected UI type as ALL, but its not working as expected on service portal. Under UI type its showing service portal option in Istanbul and Jakarta but i am using Helsinki version.    


Hello Nitesh,



From Istanbul and Jakarta version, If you use a password(encrypted type 2). it will automatically mask the field on service portal. there by you can decrypt that by the following code:



var Encrypter = new GlideEncrypter();


var encrypted = current.variable name;


var decrypted = Encrypter.decrypt(encrypted);


current.u_client_instance_password = decrypted;


current.update();


Yes surya, its working on jakarta and istambul.. its working good in helsinki if using password 2 type and that code... keep doing good work.



Thanks for your help..