HOW TO HIDE ATTACHMENTS IN A SERVICENOW FORM

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 :

mm
Sudic joined the company in 2015 and works as Technical Consultant in our Paris office. He is certified ServiceNow System Administrator and has experience in configuration and implementation for various major European companies. With his skills and experience, he helps our customers achieve Service Excellence for all areas of their business.
Recent Posts
Showing 2 comments
  • deepansh
    Reply

    trying this on jakarta
    not working

    • Sudic Mroivili
      Reply

      Thanks for your comment. The previous script applied on the previous ServiceNow’s versions (until Helsinki). We have updated the script to be functional on every version of ServiceNow, including the latest. The script working only on Back Office, not on Service Portal, because of DOM manipulation.

Leave a Comment

Start typing and press Enter to search