Document display component setup

task brazil Updated Sep 10, 2026 4 min read document-display-component-uib-setup.md
Raw file servicenow.com

The Document display component displays either HTML content or PDF attachments.

Before you begin

This task assumes you have placed the component on the page and are ready to configure the properties and events. For instructions on accessing and using features in UI Builder, see Customize UI Builder pages using components.

Note: This document describes the latest component functionality. Go to the store to make sure you have the latest version of the component.

Role required: admin or ui_builder_admin

Procedure

  1. Define a label for your Document display that differentiates it from other components in the content tree.

    A label makes finding the component easier in a large list of components. For instructions on using the content tree, see Manage UI pages and page variants.

    [Omitted image "document-display-content-tree.png"] Alt text: Content tree showing a document display component.

  2. Select the Document display component, using one of these methods:

    • Click anywhere within the component.
    • Select the Document display label you created for your component in the content tree. The property fields appear in the Config tab in the setup panel on the right.

Parent Topic:UIB Setup Information

Document display component properties

Configure the type, location, and content of the document to display. Set the document's appearance and whether it's editable.

To configure the properties, enter either static or dynamic input. Enter dynamic input by selecting the input type.

Properties

Label [property]

Description

Document type[documentType]

The type of document to be viewed.Choices:

  • Attachment record
  • HTML

The other properties to configure vary, depending on the selection you make here.

### HTML document properties

Label [property]

Description

Edit HTML content [htmlContent]

Opens an editor where you write the HTML content.

Enable editing[enableEditing]

When true, runtime users can edit the HTML. The tab for the document display includes an HTML editor.

### Attachment record properties

Label [property]

Property

Description

Attachment content type [attachmentType]

 

The type of attachment to be viewed. Choices:

  • PDF
  • Image

Attachment sys_id[attachmentId]

attachmentId

The sys_id of a document to be viewed. Instead of specifying the sys_id, you can begin typing the filename. The system gives you a list of matching files.

Target attachment sys_id[targetAttachmentId]

targetAttachmentId

The sys_id of a new target document. If document display is opened in compare mode, this will be used to combine the source and target document into one, showing the changed text in red. This can be used to identify changes between two versions of the same document.

Hide toolbar [hideToolbar]

hideToolbar

In runtime, the user can have a toolbar with search, zoom, rotation, and other functions. When Hide toolbar is enabled, users don't have access to any of the toolbar features. Default: false

Hide search[hideSearch]

 

When true, hides the search function in the toolbar. PDF only.Requires Hide toolbar to be false and the attachment content type to be PDF.

Default: false

Hide navigation[hideNavigation]

 

When true, hides the page navigator in the toolbar. PDF only.Requires Hide toolbar to be false and the attachment content type to be PDF.

Default: false

Hide download[hideDownload]

 

When true, hides the download button in the toolbar.Requires Hide toolbar to be false.

Default: false

Hide zoom[hideZoom]

 

When true, hides the zoom in and zoom out buttons in the toolbar. PDF only.Requires Hide toolbar to be false and the attachment content type to be PDF.

Default: false

Hide rotation[hideRotation]

 

When true, hides the clockwise and counter-clockwise rotation buttons in the toolbar. PDF only.Requires Hide toolbar to be false and the attachment content type to be PDF.

Default: false

Hide delete[hideDelete]

 

When true, hides the delete button on the toolbar.Requires Hide toolbar to be false.

Default: false

Hide close[hideClose]

 

When true, hides the close button on the toolbar.Requires Hide toolbar to be false.

Default: false

## Document display component events

Select event handlers to configure the actions (events) provided with the Document display component.

The Events tab shows the events used by the Document display component. To view the available events, select + Add event mapping. Select the event in the list to add one or more event handlers.

Event handlers

Event handlers work with data resources to link the Document display actions to the data you want to display to your users. Select the event in the list to add one or more event handlers.

For instructions on adding event handlers to an event, see Configure an event handler.

Event descriptions

Event

Description

Close button clicked

Dispatched when user clicks the close button or the delete button. This event doesn't have a payload.

Delete confirmation submitted

Dispatched when the user confirms deleting the document.Payload includes sysId: The sys_id of the deleted record.

HTML updated

Dispatched when the user edits HTML.Payload includes value: The updated HTML value

Search documentation
Search document titles and file paths on the brazil branch