Encrypting/Masking Variables in a Catalog Form (Integer field and String Field)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 02:18 AM
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
- Labels:
-
Integrations
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 04:11 AM
Hi Rahul and Gurpreet, Gurpreet Singh
I am not that good with the encryption thing through business rule as of now.
So can you please share a script where i can understand it and edit it according to my needs.
P.S :- Your code will give me a base as i havent done encryption through scripting earlier.
And will it be that i should be accessing the scratchpad to encrypt the field values on RITM and TASK form too?
Thanks and RGDS,
Shahid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 04:56 AM
Hi Rahul and Gurpreet, Gurpreet Singh
Also if you write a macro code for making it encrypted , the text is not getting carried over to the RITM or TASK.
It just stays blank.
Any suggestions?
RGDS,
Shahid

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 05:51 AM
Ok, I got the same
Anyhow i got a solution for storing value as encrypted value and show it on some action
The fields which is mapped with those fields make it type as decrypt Password (2 Way Encrypted)
To show the actual value you can create a UI action with below script
- function getPass(){
- var user = new GlideRecord('sc_req_item');
- user.get('sys_id', current.sys_id);
- gs.addInfoMessage(user.u_color);
- get_pass.setRedirectURL(current);
- }
See attached screenshot. However masking the variable on catalog is still a mystery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 06:03 AM
Hi Rahul,
Awesome!! .
The real requirement is to hide the value of the field and make it visible as "*****" in the RITM and TASK level.(Not on the form, if possible then it would awesome).
Can anything be done through scratchpad?
Thanks,
Shahid

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 06:43 AM
A crazy idea
- Keep the UI macro as usual
- Create a new variable(Hidden)
- Crate a catalog client script to pass the value of UI macro field to new variable
- Create a before business rule with below code
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
var current_variable = current.variables.variablename;
current.field = current_variable;
}
Rest as i explained earlier