Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
How to hide the "[view]" UI action link after disabling the Document Viewer plugin. - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • How to hide the "[view]" UI action link after disabling the Document Viewer plugin.
KB0862840

How to hide the "[view]" UI action link after disabling the Document Viewer plugin.


734 Views Last updated : Jan 2, 2025 public Copy Permalink
KB Summary by Now Assist

Summary

This article will show how to hide the "[view]' UI action link see within kb_knowledge articles and elsewhere within the platform.  This should really ONLY be used AFTER turning off the Document Viewer functionality.

NOTE: THIS IS A COMPLETELY UNSUPPORTED EXAMPLE SCRIPT AND IS PROVIDED AS IS.  PLEASE DO NOT CONTACT CUSTOMER SUPPORT FOR ASSISTANCE WITH THIS ARTICLE OR EXAMPLE.

Release

Modern releases in which the Document Viewer plugin has been installed.  Check for the plugin activation within the target environment:

Instructions

Go to: Plugins-->search for "Document Viewer" and confirm it's been installed.


Next, as this article is about HIDING the below-shown UI action link "[view]" shown below, we need to make sure that the Document Viewing functionality is disabled either globally (via a system property) or at a table level.  


See the following product documentation to DISABLE the Document Viewer:

https://docs.servicenow.com/csh?topicname=disable-doc-viewer.html&version=latest


Here, we check the system property because we've turned off the feature globally.


There is no current OOB mechanism to allow for the easy modification or hiding of the Document Viewer "[view]" UI action link.

NOTE: THIS EXAMPLE UI SCRIPT IS NOT SUITABLE FOR RELATED LISTS AS SHOWN BELOW

The following script will allow for the hiding of the "[view]" link within kb_knowledge headers and elsewhere.

1. Create a new UI Script with UI Type as Desktop, and Global checked.
2. Enter the code as shown below (see screenshot for reference as well)


~~~snip~~~
(function(){
  
  if ( !document )
    return;
 
  var styles = [
    'li.attachment_list_items > span > a:nth-child(6) { display:none !important; }'
  ].join(' '),
  
  link = document.createElement( 'link' );
   
  link.type = 'text/css';
  link.rel = 'stylesheet';
  link.href = URL.createObjectURL( new Blob([ styles ], { type: 'text/css' }) );
  (document.head || document.documentElement).appendChild( link );
})();
~~~/snip~~~

3. Go to an existing kb_knowledge article that has an attached record and notice that the "[view]" UI action link is no longer displayed.

Please tailor this example to your own needs as required.

Related Links

While mentioned several times above, it's worth saying again:

This example UI script is not supported or endorsed by ServiceNow.  Use this example script at your own risk.


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.