How to hide attachments in a ServiceNow Form

This blog was originally published by Fruition Partners. Since then, Fruition Partners has become the ServiceNow practice within DXC Technology.

In some cases it might be necessary to hide certain attachments in ServiceNow, e.g. when it is confidential information or personal data. In this Tips & Tricks we show you how to easily hide attachments in a form.

Imagine the following situation: You have a request for a mobile phone, and in order to process it you’ll need personal information as attachment (e.g. : ID, bank account details). It is important that except from the concerned people, nobody else must see it.

Example of a ServiceNow form with an attachment

Example of a form containing ID Card in attachment. Everybody who has access to the form can see it.

Follow the two steps below to hide sensitive attachments:

1) Create a new role in ServiceNow. Only people who have to see these attachments, will have the role.

Menu in ServiceNow to access to Roles

Menu in ServiceNow to access to Roles

2) Create a OnLoad client script which uses the role

NOTE : The following script will be applied on every form of the table you selected for the script. To apply it on a particular situation, you just need to add another « If » condition.

Script :

Speak Your Mind


This site uses Akismet to reduce spam. Learn how your comment data is processed.