he Document Generator is a Premium Custom Action that can integrate with Lightning Forms and Lightning List Actions. The Document Generator Action enables you to generate a Microsoft Word document that maps to fields within SharePoint List Items. An example would be of using a SharePoint list form to create a Purchase Order. The Purchase Order information can then be taken from the list to create the Word document in a Purchase Order layout suitable for sharing with a supplier.
Watch a Quick Overview Of the Document Generator
Within this video, we explore the Premium Document Generator action for use within SharePoint Online Modern Lists via Lightning Forms or Lightning List Actions. The Document Generator Action allows us to build an Action Button to generate a Microsoft Word document that references the fields from the current SharePoint list item, or list items using a query.
Building the Microsoft Word Document
Any Microsoft Word Document can be used by the Document Generator Premium Action. In order to reference the fields within the SharePoint List Item, double squared brackets are used to reference a SharePoint column name. Loops can also be used to loop through each item within a sublist on a SharePoint form. In this example, we generate an Expense Report Document and loop through each expense item on the expense report.
Building the Custom Action within Lightning Forms
Using the Action Builder, the Document Generator Action is used to upload the Document Template, and reference the SharePoint list item using the [[ID]] column, and setting a file name pattern.
Using Lightning List Actions
using Lightning List Actions, the Document Generator can be used within the List command bar allowing documents to be generated from one or more selected SharePoint list items.