Document preview

A preview of a document from a related widget, right on the form page.

About the documentPreview widget

The widget shows a preview of a document directly on the form, without opening the document and without hovering. It takes the document from a Related documents widget on the same form. It is a virtual widget, not stored in the item, and needs no extra licence.

Adding and linking

On the Widgets tab choose Document preview and drop it into a section. In the settings pick the Related documents widget that supplies the document. The list offers only the Related documents widgets of this form; if there is none, add one first.

Settings

OptionPropertyMeaningDefault
Related documents widgetsourceFieldIdInternal name of the widget that supplies the document. It must exist, otherwise the configuration fails validation.not selected
What to previewsourceRelated documents (relatedDocuments) or Current file (currentFile): the file whose properties the form edits. Current file is offered only on a document library and does not need a Related documents widget; the New form shows an empty state. The Open button opens the document in a new tab.Related documents
Height (px)heightPreview height, 200 to 1200.480
Document shownselectionFirst, a click in the list switches (firstOrClick) or Always the first (first).first, click switches

Runtime behaviour

Configuration example (JSON)

{
  "internalName": "widget_docpreview",
  "customLabel": "Document preview",
  "fieldType": "documentPreview",
  "colSpan": 12,
  "documentPreviewConfig": {
    "sourceFieldId": "ProjectDocuments",
    "height": 480,
    "selection": "firstOrClick"
  }
}

Limits and tips