How to mask PPI Information in HR Profile table

pinkiverma
Kilo Contributor

Hi,

I have cretaed a scheduled job to mask PPI information on HR profile table. Below is my script:

var gm = new GlideRecord('sn_hr_core_profile');
gm.query();
while (gm.next()) {

gm.ssn='xxx';                                                                //string field

gm.ethnicity= 'XXX';                                                     //string field
gm.address= 'XXX';                                                      //string field
gm.date_of_birth ='1999-99-99'';         //date field
gm.home_phone.='1 555 555-5555';  //choice field
gm.email ='Primary@email.com';                 //reference field. data coming from user table
gm.update();
}

when i execute this scheduled job only string fields are getting masked(ssn, address). while date,choice and reference fields are not masked.

 

find_real_file.png

Did anyone else faced this issue. 

Regards,

Pinki

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Pinki,

Are you saying on form load for hr profile the values for those fields should be masked with *****

you are updating the record with that value XXX and that would lead to incorrect information

any valid user with HR profile won't have XXX in home address

you should use display business rule on hr profile table and use below script to mask those; it will just show the value as XXX but not update in table

Script:

current.ethnicity = 'XXX';

I tried for email and date field but this somehow doesn't work

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sai Anna
ServiceNow Employee
ServiceNow Employee

Hello,

Can I know what is the purpose of masking? I assume you are running the above script in sub production environments. you can also add an ACL on these fields so that users cannot view it. if you would like to have some random values in sub production then you can use above script.

 

For updating reference fields please use setDisplayValue('');

example:

gm.setDisplayValue('TBD'); // Replace TBD with actual value in that table. XXX might not be proper record in target table. Select any existing record value

 

Same on Choice fields. either you can gm.clearValue() or select one of the existing choice values.

 

Phone Number needs +1

gm.home_phone='+15555555555';

 

for dates use

var gDate = new GlideDate();
gDate.setValue('2015-01-01');

gm.date_of_birth = gDate;


 

Thanks,

Sai

Hi Sai, Our client don't want to show senstive information to everyone on hr profile. So we are making data Regards, Pinki verma

Hi Pinki,

then block the read access to the table itself for those set of users using table level READ ACL

that is the recommended approach

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader