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

Oops i missed this post, answer to your question


- "make it visible as "*****" in the RITM and TASK level" yes this is encryption on RITM and Task table not on form.


I have tried to do similar to your requirement


- Created a UI macro and added it on the catalog as variable with label (Type password)


<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<input type="password" name="somename" id="someid" />


</j:jelly>


- Created a new variable and hide it.(using catalog UI policy)


- Created a catalog client script to set the UI macro value to new variable as below


function onSubmit() {


    //Type appropriate comment here, and begin script below


    var color_id = document.getElementById('someid').value;


  alert(color_id);


  g_form.setValue('color', color_id);


}


- created a new on Before business rule on insert as below


function onBefore(current, previous) {


    //This function will be automatically called when this rule is processed.


    var current_color = current.variables.color;


    current.u_color = current_color;


}


- Created a new field (related field on RITM) on the form as "password2".


- Created a UI action on form with below code


getPass();


function getPass(){


var user = new GlideRecord('sc_req_item');  


user.get('sys_id', current.sys_id);  


gs.addInfoMessage(user.u_color);


action.setRedirectURL(current);


}


I hope this will help . Please see attached document for results


thanks for your code,


we have similar requirement



added UI Macro and created a variable on catalog item and attached it to UI Macro


label : Type Password


system name : typepassword


and created submit client script, BR and ui action.


i don't want to create a new field on ritm , instead it has to show in variables section find_real_file.pngfind_real_file.png



while submit request it prompt a dialog with text given in variable


when i go to RITM it shows "UNDEFINED"


find_real_file.png



for this point it is good,


from next step i have two questions 1. why BR and an on which table we have to write BR


and where the system name has to be passed


please help me with this




---- this is an urgent requirement for us ------


I think you are missing one point here, you need to pass the value of field created by UI macro to the variable you have created. I have done it in on submit client script.



Get Outlook for Android<https://aka.ms/ghei36>


catalog item i have created


find_real_file.png


Catalog client script : ON SUBMIT


find_real_file.png


Business rule -


Table : Requested Item [sc_req_item]


when : before


insert : checked


update : unchecked


find_real_file.png


ui action written on sc_req_item table


find_real_file.png



when i submit request ti prompt a dialog with text given in table


and i navigate to req-> ritm


and found ui action and field on ritm


after hit on ui action   i got this



find_real_file.png


please correct where i made it wrong