How to mask PPI Information in HR Profile table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 02:25 AM
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.
Did anyone else faced this issue.
Regards,
Pinki
- Labels:
-
HR Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 02:52 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 06:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 09:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 10:10 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader