The SharePoint Document Viewer lightning component is a featured component that allows previewing a SharePoint document or linking a specific document by saving the document URL into a specific field on the record. For more information, follow this link.
How do I add the Document Viewer to a lightning page?
Deployment Use Cases
The document viewer component is designed for use within lightning home, app and record pages. The primary use case for the component is within the context of a given record; however, the component may also be deployed to any lightning page.
- Identifier: Use a unique identifier to identify this component on the lightning page. The document viewer can be deployed multiple times on the same page layout. This option provides each instance of the component a unique set of run-time options.
- URL Field: Optionally, select a field to store the URL of the document the user selects to display within the component.
- URL of your document: Optionally, provide the URL of the SharePoint document to be loaded in the component.
- Height of the document viewer (in pixels): Provide the height of the document viewer component.
- Login As - Optionally, provide a user to automatically authenticate all SharePoint related operations within the component. The provided user must be enabled as Secured Login within SharePoint Setup. For more details, follow this article.
When a Login As user is provided within the app builder deployment options, all operations related to SharePoint are performed on behalf of that selected user. The current user cannot log in or log out from SharePoint from within the component.
If the provided secured logged in user logs out from their environment, then the user is logged out from all instances of the components where the secured login has been setup to use as via the Login As option.
Using the Document Viewer
Each instance of the component can be bound to a single document.
- If the URL Field is provided in the component deployment options: once a user has chosen a document to be viewed in the component, AdvoLogix will save that document's URL in that field, and this gives the option for users to bind different documents to different records.
- If the URL Field is left empty and the URL of the document is provided in the component deployment options: AdvoLogix will load the same document for all records this component is visible on.
Navigating the Functions Available within the Component
Choose Document - Allows users to browse the SharePoint documents and select a document within the component.
- If the URL Field is provided in the component deployment options, then the selected document's URL will be saved in the URL field.
- Open in SharePoint - Allows users to open the document in SharePoint in a new browser tab.
- Zoom Out - Navigates the user to the full-view mode of the document.
Close- Close the currently selected document.
- If the URL Field is provided in the component deployment options, then the field's value will be cleared out on this action.
- Document Viewer - Provides a preview of the selected document.
The document viewer lightning component allows previewing of only Microsoft Office files (.docx, .xlsx, & .pptx).