How to encrypt variables in incident form variable editor

FaizDev101
Tera Expert

I have created some variables in Incident variable editor using Record Producer.

The requirement is to mask the variables in the variable editor to (*******) format.

FaizDev101_0-1695120234257.png

All the variables in the variable editor should be in encrypted format after submitting the record producer .

Please provide some suggestions regarding it.

4 REPLIES 4

Hemanth M1
Giga Sage
Giga Sage

Hi @FaizDev101 ,

 

Use Masked type variable instead Single line text.

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

It should be encrypted after submit the record producer

@FaizDev101 

 

Create a two variable 

1)Single line text

2)Masked Type

3)Hide masked type during subission

4)After submission, copy the info from single line text to masked type

5)Hide Single line text on the RITM post submission 

 

You can decrypt as below 

current.variables.A.getDecryptedValue(); //current.variables.<variable name>

 

Refer : https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0681163

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Hi @FaizDev101,

 

You can use Masked variable type, there you will get an option for show and Hide.

 

Apart from you can use base64 encryption supported by ServiceNow after submitting on your RITM. but it will not give you result in (*****) format intend it will give you result in (dGVzdDExMQ==) format.

To use Base 64 encryption you can use below code 

var base64string = GlideStringUtil.base64Encode("Your Variable Value");   

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks
Vijay Balotia