Document Generation
Note: This is an external action and may execute on servers running outside your data center Centralized locations used to house servers used by Nintex for remote storage, processing, or distribution of data. Nintex has a number of regional data centers available for Nintex for Office 365. For information about Nintex data centers and where your data center is located, contact your Nintex account or territory manager. region. Before implementing, consider performance and regional concerns where digital boundaries are an issue. For more information, see In-tenant and external actions.
Use the Document Generation action A tool for building the processes, logic, and direction within workflows. to automate document generation and generate one or more generate template-based documents that include variables and images from your workflow. Use the Nintex Document Tagger to select tags that you can insert into your templates A document where data from your workflow is inputted to be transcribed when the document generation process is initiated..
You can create documents using SharePoint lists and libraries with the use of document templates. Select from existing templates in a document library or create new templates in Microsoft Word, Excel or PowerPoint.
The Generate document creates one or more documents per your configuration:
- A single PDF file.
- Separate PDF files.
- Same file type as the template: .docx, .pptx, or.xlsx.
You can even configure the Document Generation action to create image tags and then insert those image tags into the templates used for outputting your documents.
Note: If your Nintex tenant resides in our European data center, then documents generated via the Document Generation action remain within the European region.
Variables are placeholders that store information that changes each time the workflow runs or even during execution of a single workflow instance.
Each variable has a type that determines what values can be stored in the variable, such as a date, number, file path or a workflow user name. For example, if you want to save the name of an employee in a variable, you have to create a variable of type Text. The workflow can then store a name of the employee, such as "John," in the variable.
- Text: Text string.
- Boolean: Yes or No value.
- Date/Time: Date and time value.
- GUID: Globally unique identifier, often used to reference a list item in SharePoint.
- Number: Integer number with decimal value.
- Integer: Integer number with no decimal value.
- Choice: A value that requests a selection from a list of allowed values.
- Person or Group: A value that requests a selection from a user lookup.
- Hyperlink: A value that requests a hyperlink URL and description.
- Dictionary: A container that holds a single logical unit of variables. For more information, see Dictionary variables.
- Collection: An index-based array of values, also known as an ordered list of values. For more information, see Collection variables.
In NintexOffice 365, the different categories of variables that can be used in a workflow are given below:
-
Workflow Context: Context variables that represent data related to the current workflow instance, such as current item or site URL and workflow name.
- Workflow Variables: User-defined variables that you create to store values such as file paths, dates, workflow outputs Variable to store a value or file on completion of the workflow. and other data for use throughout the workflow.
- Start Variables: Workflow variables with the initiation option selected. Start Variables are used to get data from users when a workflow manually starts.
For more information on manually starting a workflow, see .
- Text
- Boolean
- Date/Time
- Number
- Choice
- Person or Group
- Hyperlink
To configure a variable as a start variable, select the Initiation option when creating a variable.
You can insert an existing Workflow Variable or Context Variable into the configuration fields of workflow actions A tool for building the processes, logic, and direction within workflows. and you can create user-defined variables for use throughout your workflow.
You can create user-defined variables from the Action configuration window when you are configuring a workflow action or from the toolbar of the designer page.
- In the Action configuration window, click in a field that accepts variables.
- Do one of the following depending on the method available;
- On the drop-down list that appears, Click Create New Variable.
- On the Insert Reference pane that appears, expand the Workflow Variables section and click Create New Variable.
- Do the following in the Workflow Variables pane to create the variable:
- For Name, type the variable name you want to use.
- Select a Type.
- If you want to display the variable on the start form, select the Show on start form check box.
- Click Create.
- On the toolbar of the Designer page, click Variables. The Variables dialog box appears.
- Click New and fill in the following:
- For Name, type the variable name you want to use.
- For Type, select a variable type corresponding to the type of data you want to store.
- If you want to specify the variable as a start variable, select the Initiation check box.
- Click to specify the Initiation options Initiation options control the display and behavior of the variable on the start form that is displayed when a workflow is started manually..
- Click Save.
For more information, see User-defined variable types and Initiation options.
The following table describes the variable types available in the Variables dialog box as well as their initiation options, which are available when you select Yes for Initiation. Initiation options control the display and behavior of the variable on the start form that is displayed when a workflow is started manually.
Variable type | Description |
Initiation Available |
Initiation options |
---|---|---|---|
Text |
Any text value. Underlying .NET data type: System.String. |
Yes |
|
Boolean |
Yes or No value. Underlying .NET data type: System.Boolean. |
Yes |
|
Date/Time |
Date and time value. Underlying .NET data type: System.DateTime. |
Yes |
|
GUID |
Globally unique identifier, often used to reference a list item in SharePoint. Underlying .NET data type: System.Guid. |
No |
(n/a) |
Number |
Numeric with a Decimal value. Underlying .NET data type: System.Double. |
Yes |
|
Integer |
Numeric without a decimal. Underlying .NET data type: System.Int32. |
No |
(n/a) |
Choice |
A value that requests a selection from a list of allowed values. The value selected by the workflow initiator is stored in the variable. Underlying .NET data type: System.String. |
Yes |
|
Person or Group |
A value that requests a selection from a user lookup. The item selected by the workflow initiator is stored in the variable. Underlying .NET data type: System.String. |
Yes |
|
Hyperlink |
A value that requests a hyperlink URL and description. Two text boxes are provided:
The values entered by the workflow initiator are stored in the variable. Underlying .NET data type: System.String. |
Yes |
|
Dictionary |
A container that holds a single logical unit of variables. For more information, see Dictionary variables. Underlying .NET data type: Microsoft.Activities.DynamicValue. |
No |
(n/a) |
Collection |
An index-based array of values, also known as an ordered list of values. For more information, see Collection variables. |
No |
(n/a) |
You can insert a Workflow Variable, Reference A workflow reference which is used to construct content containing information specific to the list or library item and to the current instance of the workflow. or a Context Variable into the configuration fields of workflow actions A tool for building the processes, logic, and direction within workflows..
Each field that accepts variables accepts one or more methods for inserting variables. The method available differs depending on the field.
Available methods are given below:
-
Click on the field and select an existing variable from the drop-down list for the field.
- Click on the field, click Create New Variable, and fill the following fields in the Workflow Variable pane that appears:
- For Name, type the variable name you want to use.
- Select the Show on start form check box if you want to display the variable on the start form.
- Click Create.
- Click on the field, select Workflow Variables or Workflow Context, and select a variable from the corresponding drop-down list.
- Click Advanced Lookup, select Workflow Variables or Workflow Context from the drop-down list that appears, and then select a variable from the corresponding drop down and click Insert.
- Click on the field that accept references and from the Insert Reference pane that appears on the right, double-click on a reference to select. Available sections and lookup values depend on the options available for the workflow action.
- Current item URL: The URL of the item the workflow is associated item. Available only for list workflow actions.
- Current site URL: The URL of the site the workflow is associated site.
- Initiator login name: The login name of the person who started the workflow instance.
- Initiator display name: The display name of the person who started the workflow instance.
- Initiator email address: The email address of the person who started the workflow instance.
- Instance ID: The unique identifier of the workflow instance.
- List ID: The unique identifier of the list the workflow is associated with. Available only for list workflow actions.
- List Name: The name of the list the workflow is associated with. Available only for list workflow actions.
- Manager login name: The login name of the manager of the initiator (the person who started the workflow instance).
- Manager display name: The display name of the manager of the initiator (the person who started the workflow instance).
- Manager email address: The email address of the manager of the initiator (the person who started the workflow instance).
- Publish user: The person who published the workflow.
- Workflow name: The name of the executing workflow.
Section | Description |
---|---|
Item Properties |
Metadata columns for the item the workflow is associated with. Available only for list workflows. |
Workflow Context |
Context variables that represent data related to the current workflow instance, such as current item or site URL and workflow name. |
Workflow Variables | Workflow variables configured for the workflow. |
You can configure variables to collect data when a workflow is manually started. These variables will be shown on a start form used to initiate the workflow and allows users to specify a value for the workflow variable before the workflow starts, basically passing values into the workflow before it starts.
Variables displayed on a start form are also known as the "start data" of the workflow and represent data that must be collected when the workflow is started.
Note: If the workflow starts automatically, then default values are used for start data.
To learn how to manually start a workflow, see Start a workflow manually.
Configure a variable to show on a workflow start form:
-
Open the required workflow. The workflow designer opens.
- On the toolbar, click Variables. The Variables window opens.
-
To edit an existing variable, click the required variable. The row becomes editable.
or
- Select the Initiation check box for the required variable.
- If you want to configure initiation options, click to open the Initiation options dialog box, make the changes and click OK. For more information about the fields, see User-defined variable types and Initiation options.
To create a variable, click New on the Variables window toolbar, enter a Name, and select the Type for the variable.
- Click Save to commit changes.
In the Designer:
- Click the Libraries and Lists action group in the action toolbox.
-
Do one of the following to open the Action configuration window:
- Double-click the action.
- Click on the action and then click Configure.
See Action configuration window for more information.
- Select the Generation type.
- Add and tag document templates, tables and images.
- Select a Template document library.
- Select a Template. All templates saved in the Template document library is shown in the drop down list to select from.
- Click Create new template.
- Type the Name.
- Select a Format.
- Click Create and open. The document template is created in the document library selected in the Template document library field.
- Select an option for Include template.
- Click Insert.
- On the Document Generation Action configuration window toolbar, click Table Data.
- Type a Table name.
- Select the Repeated format type.
-
For the first column, do the following:
- Select a Collection variable.
- Select a Data type for the variable.
-
To add another column, click Add column.
- Click Insert.
- To add another table click the Add table button.
- On the Document Generation Action configuration window toolbar, click Images.
- Type an Image name.
- Type the Image URL.
- Click Insert.
or
Type the action name or function in the Search field at the top of the action toolbox.
In the Document templates section:
For more information on the fields and buttons see, Document templates fields, buttons and settings.
For more information on the fields and buttons see, Table Data fields, buttons and settings.
For more information on the fields and buttons see, Images fields, buttons and settings.
- Select the Output location.
- Click Save.
For more information on the fields and buttons see, Document Generation fields, buttons and settings.
When the workflow runs, the Document Generation action identifies the tags in the document templates and inserts the corresponding values from your workflow into the documents it generates.
- Open the document you want to tag.
-
Select the area in the document template where you want the tag value to appear.
-
In the Nintex Document Tagger pane on the right, expand a sub section to expand it and see related tags.
- To insert the tag do one of the following:
- Open the document you want to tag.
-
In the template, select the cell or range of cells that you want to tag.
-
In the Nintex Add-in for Outlook Document Tagger pane on the right, select the tag you want. The tag is copied to your clipboard.
- Paste the copied tag in the Name field that's available at the left of the formula bar.
The Name field is only available in the desktop version of Microsoft Excel.
When the workflow runs, the Document Generation action identifies the image tags in the document templates and inserts the corresponding images from your workflow into the documents it generates.
You can add image tags directly within the document or overwrite existing Microsoft image tags in placeholder images. Use the placeholder method to ensure a particular size for the image.
For instructions to add image tags directly to the template, see Add tags to document templates.
To add an image to a generated document at a different size to the original image, you need to add a placeholder image of the size you want to the document template, and then label that placeholder image with an image tag. When your workflow runs, the Document Generation action replaces the placeholder image in the document template with the image from the tag, but resizes it to the dimensions of the placeholder image.
- Open the document you want to add image tags to.
- Insert a placeholder image of the size you want into the document template. For instructions on inserting images, see Insert pictures.
- Click the placeholder image you add, and click the Format menu in the ribbon of the document template.
- Click Selection Pane. A Selection pane opens on the right side of the document.
- Copy the image tag from NintexDocument Tagger that you want to add to the document template.
- Click next to the variable you want to add and click Copy
- Paste the copied image tag into the image label field.
- Save the file.
Document Generation Error
If you receive this error, "Workflow for O365 Document Generation Suspended with InternalError," see if the Column names in your list contain underscores, and remove them.
Important: The underscores in the Column names can cause errors in your Document Generation action, therefore using underscores must be avoided when naming columns.
Section |
Field |
Description |
---|---|---|
(unlabeled) | Generation type |
Option for number and types of documents generated. Choose one of the following options:
Merge overrides Generation type. For example, if you select Page break for merge and Original file types for generation type, the files will merge into one output using the last output file name specified. |
Output location | Output location |
The output location to store documents generated by this action. |
Folder path |
The folder path to store the generated documents. For more information about how to use Lookups in configuration fields, see Lookups in action configuration fields. Important: Ensure the correct file path is given. If the given path is incorrect the workflow fails and you will not be able to resume the workflow after correcting the path. |
|
Store output file URL in | Variable to store the output file path. | |
Overwrite existing item |
When selected, overwrites the current document with the generated document. If this option is not selected, and a document with the same name exists, the date and time is applied to the end of the file name. |
|
Enable logging for quota alerts in Workflow History |
When enabled, logs Document Generation quota usage messages to the Workflow Status page. |
Section |
Field |
Description |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Add template
|
Order |
The order to place the template in the generated output. For example, if you want to place the template first in a document that has 2 templates, select 1. |
||||||||||||||
Template document library |
The document library for the template. The document libraries available in the site is displayed in the drop-down list. | |||||||||||||||
Template |
Template to generate the document. Displays a list of existing templates saved in the selected template document library. You can select one of the existing templates in the document library or ,click Create new template to create a new template in the document library. If you create a template in a document library with content approval settings applied, you must manually check in and publish the new templates created. For more information on content approval in document libraries, see Require approval of items in a site list or library. If this is not done "Missing" errors causes the action to fail when the workflow runs. |
|||||||||||||||
Include template |
Condition to determine when to include the template. Choose one of the following options. Always: Always include the template. Based on condition: Include the template only when the specified conditions are true. |
|||||||||||||||
Expression |
(Available only when Based on condition is selected for Include template). Conditions for Based on condition option. Expression Field descriptions
|
|||||||||||||||
Merge |
(Only available for consecutive templates of the same file type). How the files will be merged to in the final output document. This merging type will be used when merging content from the previous template with content from the current template into a single generated document. Microsoft PowerPoint and Microsoft Excel: When Merge selected, combines templates together in the generated documents. Microsoft Word: Combines templates based on the Merge options selected. The template inherits the styles from the preceding template. Merge options for Microsoft Word
|
|||||||||||||||
Tag document |
Launches the Nintex Document Tagger into Word, Excel or PowerPoint depending on the template type selected. You can use the document tagger to add tags and into the document template and define where the action should enter the data into the document. The tags are mapped to variables available in the workflow and to input dynamic data from the workflow into the document. At run time the workflow dynamically assembles the output document. For more information, see Nintex Document Tagger |
Section |
Field |
Description |
---|---|---|
Add table
|
Table name |
The name of the table as it appears in the table section of the Nintex Document Tagger. Dynamically generates tables from collection variables, which can be inserted as tags into tables in the templates. |
Repeated format type |
Use repeated format types to create tables or sections from query results obtained from lists or libraries. Choose one of the following options:
Use Row as Repeated format type
Row repetition uses tags that pull data from collection variables to repeat information in a table as a new row. Supported formats: .docx, .pptx, .xlsx.
For information on how to insert a table, see the Microsoft article Insert a table.
When the workflow generates documents from the tagged templates, the tagged data appears in new rows. Use Table as Repeated format type
Table repetition uses tags that pull data from collection variables to repeat information in new tables. Supported formats: .docx and .pptx.
When the workflow generates documents from the tagged templates, the tagged data appears in new tables. Use Section as repeated format type
Section repetition uses the Microsoft Word Rich Text Content Control and collection variables to repeat data in new sections. Supported format: .docx only.
|
|
Table columns |
Define columns in the table. A collection variable is selected for each column in the table. |
|
Table columns |
Collection variable | The collection variable to use for the table columns in the document. |
Data type |
The format to apply to the column in the table. Supported repeated format types:
|
|
Internal column name |
The SharePoint internal column name for complex collection variables. How to get the internal column name of a list column
For example the URL for Created By edit column page is: https://abc.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7B8849257A-4C41-4138-BD00-2E59C3E9BE15%7D&Field=Author The internal name appears at the end of the URL after Field= In this example URL the internal name is Author. |
|
Add column |
Displays configuration fields for adding another column to the table currently being edited. |
|
(unlabeled) |
Add table |
Displays configuration fields to add another table. |
Section |
Field |
Description |
---|---|---|
Add an image |
Image name | The name of the image as it appears in the Images section of the Nintex Document Tagger. |
|
Image URL |
SharePoint Online or publicly accessible URL for the image file. For more information about how to use Lookups in configuration fields, see Lookups in action configuration fields. |
|
Add image | Displays configuration fields to add another image. |