Field Encryption in Servicenow

Pushkar-Snow
Mega Guru

Hello,

 

I have to encrypt some fields on the Request task Table but only for specific catalog not for all the catalogs. I went through the service now documentations. But I understood that we can only apply the encryption to the whole column on catalog task table not to specific catalogs task records. Any help would be appreciated....

 

Regards,

Pushkar

1 REPLY 1

Tushar
Kilo Sage
Kilo Sage

Hi @Pushkar-Snow 

 

You are correct, you can only encrypt the entire column in the Request Task table.

However, I believe that below workaround you can use to encrypt specific fields for specific catalogs.

The workaround involves using a business rule and a GlideRecord call.

The business rule will be triggered when a new request is created for a specific catalog. The BR will then call a GlideRecord call to encrypt the sensitive fields in the request.

 

something like this 

 

var gr = new GlideRecord('sc_req_item'); // Use the correct table name for Request Task
gr.addQuery('catalog_field', 'catalog_value'); // Define the condition for the specific catalog item
gr.query();
while (gr.next()) {
  gr.your_sensitive_field = gs.encrypt(gr.your_sensitive_field);
  gr.update();
}

 

 


Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar