Generate Document

<< Click to Display Table of Contents >>

Navigation:  NITRO™ Workflows > Configuring Workflows > Workflow Actions >

Generate Document

Generate Document Action:

This action is used to generate a document in document library using Word and Excel templates. This manual will describe how to use place holders to generate a formatted document using variable data. This will also describe setting up Item and List Print templates using place holders.

 

Generate Document action in designer workflow:

 

 Generate document in designer

 Generate document in designer 2

 

 

 

Generate Document action in legacy workflow:

 

 Generate document in legacy

 

Generate Document Action is divided into four parts

General Settings

Document Template

Save Document In

Column Mappings

 

General Settings:

 

Action Name: enter a unique name for this Generate Document action.

Action Description: enter a description for Generate Document action.

Delay Execution: it will delay action execution for specified seconds.

Document Template:

 

Template Type: select template type for the document that you want to generate. Supported Template types are

oMicrosoft word

oMicrosoft Excel and

oItem Print Template

 Microsoft word: Microsoft word template can be generate using 'Open XML API' and 'Microsoft Office API'.

Microsoft word

 

Open XML API: below settings will be visible when document is generated with 'Open XML API'. Documents generated with 'Open XML API' template can be saved with 'Doc' and 'DOCX' extension.

remaining settings are same as other template types. these settings are explained in further section.

 

Open XML API

 

Microsoft Office API: below settings will be visible when document is generated with 'Microsoft Office API'. Documents generated with 'Microsoft Office API' template can be saved with 'Doc' 'DOCX' and 'PDF'  extension.

remaining settings are same as other template types. these settings are explained in further section.

Microsoft Office API

Replace un-mapped merge fields with blank: default value for this setting is "true". It will replace all un-mapped column value with blank.

Content Control Mapping: for detail on content control mapping refer this article

Protect with Password: documents generated with 'Microsoft Office API' can be protected with password. Select this option to provide password for document as shown below.

Protect with password

 

 

Add Watermark: you can add text based watermark for documents generated with 'Microsoft office API'. column placeholders can also be used in watermark.

Watermark Font Size: this provides the option to select font size for watermark.

Watermark Layout: watermark can be added diagonally or horizontally in a generated document.

Sample template for Microsoft Word ( supported in both 'Open XML API' and 'Microsoft Office API':

Sample template Microsoft word

In Microsoft Word, merge field is supported in header and footer also.

To map merge field name in Microsoft word template,

Move the curser to required position in the word document. Then go to 'Insert' in Microsoft Word -> Quick Parts -> Field

Curser Position

merge field

below window will open. Go to

Merge field mapping

Priority field name is added at required curser position in the document as shown below

Priority field added

Note: field names can be different from SharePoint list column names.

These fields name will be available in generate document action merge field mappings.

Merge field mapping fields

Click 'Add Column Mapping' button.

Template Field name

Merge Field: All fields name specified in template will be shown in Merge Field dropdown.

Column Value: It supports Fixed value/ Column Placeholder/ Function. To map column placeholder, select column placeholder from 'Columns' panel and click 'Add Placeholder to Value'. To map functions, select function from 'Functions' panel and click 'Add Function to Value'.

Value Format: Select value format from available options to specify output in particular format. Supported value formats are 'Normal', 'HTML', 'Plain Text', 'HTML(Extract Table).

Normal: normal text is a text with basic style and formatting like basic font style (bold, italic), simple alignment etc

HTML: It includes text, images, links, forms and multimedia. it display the content in more structured manner.

Plain Text: plain text is a text with no style and formatting

HTML(Extract Table): extracts structured data from HTML tables for further analysis and use.

 

Sample example of merge fields:

Sample merge fields

Sample Output document:

sample microsoft output document

 

Microsoft Excel: below settings will be visible when document is generated with 'Microsoft Excel'.

Microsoft excel

 

Sample Template for Microsoft Excel:

Excel sample template

Format to specify merge fields: [[Field Name]]

Note: These field names can be different from SharePoint list column names.

Above template merge fields will be available in merge fields mappings as shown below:

Sample excel merge fields name

 

Sample Output  of Excel document:

Excel sample output

 

Item Print Template: below settings will be visible when document is generated with 'Item Print Template'. Documents generated with 'Item Print Template' can be saved with 'PDF'  and 'Word Document' extension. These documents can be protected with password.

 Item Print Template

Item Print Template: this dropdown will show all configured item print templates for the list on which workflow is configured.

Click gear button to configure Item Print template as shown in above image. or

Go to NITRO Studio -> Click Print Manager App or

Go to List Settings -> Crow Canyon Print Manager Settings

Print manager app

 

Print manager from list settings

Below window will open. Go to 'Manage Item Print Template' tab -> click 'New Item Print Tamplate' button to generate item print template

Item Print Template tab new

 

 It supports two template types.

 - Rich text with column value placeholder: In this template type, create print format by adding field of list from right side panel by double clicking on the field.

 Sample example:

 Rich text template type

Sample Output:

Sample output of Rich text item template

 

 - Table with selected column names and values: In this template type, table with selected view columns names and value will be print. User can add columns of their choice in template by selecting 'Use Filter Columns' option in Specify Columns.

 

 Table with selected fields

Sample Output:

Sample output of table item print

Note: NITRO Form Template Type in item Print manager is not supported in Generate Document Action of NITRO workflows.

 Common fields in both template type of Item Print Template:

Title: Provide Title for Item Print template.

File Name: Provide name with pdf/png extension.

Default Template: Select this option to make it a default template.

List: The dropdown will show all available lists in the site collection. select list for which you want to configure item print template.

Provide other settings 'Style', Header', 'Footer', 'QR Code/Barcode and 'Advanced' as per requirement.

 

Note: Once the template is created, upload the template to document library of site from where you want to access it.

'Document Template' Section Common Fields in Microsoft Word and Microsoft Excel Template Types

Select Source Site URL: Select site from current site collection or provide site URL of cross site or cross site collection.

Library: This dropdown will show all document libraries of selected site collection in above step. Select library which is having document template file.

Template File Source: It has two options.

 Select File: select this option to select template file from above selected library.

         Template File: This option will be shown when 'Select File' option is selected. It will show all files of selected library in dropdown that support selected template type.

         For Example: for Microsoft Office, it will show all files with 'docx' extension.

                           for Microsoft Excel, it will show all files with 'xlsx' extension.

 

         Select File

 Enter File Name:

It supports fixed value (Provide file name directly), text and lookup columns placeholder.

If a text column/lookup column is selected then column value is expected to have the document name with extension.

If placeholder is selected then it will not show the merge fields in a dropdown as there is no source document to read from. for this scenario,'Merge Field File(s) option is provided. file(s) selected in 'Merge Field File(s) option is used for merge field mappings. At runtime,it will replace fields of template with matching merge field(s) configured in merge field mappings.

Enter file name

Merge Fields File(s): Specify file(s) to get merge fields and content control names. Based on these names, mappings can be configured.

 

'Save Document In' Section Common Fields in Microsoft Word, Microsoft Excel and Item Print Template Types

Save To: You can save the formatted document either in document library or in current item.

Select Target Site URL: Select target site URL either from current site collection or you can specify URL from cross site or cross site collection.

Library: It will show all document library of provided Site in above step in dropdown. Select target library where you want to save the document.

Folder Path Name: This is optional. provide folder path name of selected library where you want to save the document. Item column values can be specified as placeholder in folder path name.

File Name: Provide file name with which you want to save the document. Item column values can be specified as placeholder in file name. for example: Ticket_%%[ID|ID]%%

         for placeholder syntax is: %%[Column Display Name|Column Internal Name]%%

Overwrite Existing Files: If target library have the file which has same name with which you want to save your document then selecting this option will overwrite the existing file. If this option is not selected, then provide unique name for file else it will not create document in target library.

Save as: For different template types, it shows differnt options. Select option with which you want to save your generated document. Example:  Docx, PDF etc

 

Column Mappings' Section Common Fields in Microsoft Word, Microsoft Excel and Item Print Template Types

Column Mappings: This option will be available if 'Document Library' is selected in 'Save To' in above section. Click 'Add Column Mapping' button to map target library columns with list columns or function on which workflow is configured.

Column Mappings of target library