How to encrypt variables in incident form variable editor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2023 03:47 AM - edited ‎09-19-2023 05:09 AM
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.
All the variables in the variable editor should be in encrypted format after submitting the record producer .
Please provide some suggestions regarding it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2023 04:50 AM
Hi @FaizDev101 ,
Use Masked type variable instead Single line text.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2023 05:07 AM
It should be encrypted after submit the record producer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2023 05:13 AM
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
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2023 05:28 AM
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