Create documents with Document Generation

The Document Generation task is powered by Nutrient Document Engine and allows for PDF and DOCX files to be created from request data using a DOCX file template that contains placeholders.

Prerequisites

Before using Document Generation, ensure you have:

  • Access to Nutrient Document Engine
  • Administrative permissions to configure tasks in your workflow process
  • A DOCX editor (such as Microsoft Word) to create templates

Document Generation task configuration interface showing general settings and mapping options

Advantages of using Document Generation

Document Generation offers several advantages over using the traditional PDF Generator task:

  • Simplified template creation — Design your document templates using any editor that supports saving files in DOCX format, avoiding the complexity of creating fillable PDFs, which often requires specialized third-party software.
  • Grid mapping — Document Generation allows you to seamlessly map entire grid data sets into your documents — functionality that’s not available with the traditional PDF Generator task.
  • Enhanced multi-option question handling — This task provides more flexible ways to represent multi-option questions within your documents.
  • Support for multiple output formats — With Document Generation, you can generate your documents as either PDF or DOCX files, giving you more options based on your needs.

How to generate a document

  1. Create a DOCX template with placeholders in MS Word. The following image is an example of how this looks.

    DOCX template example showing placeholders for dynamic data insertion

    • Design your template using any editor that can save DOCX files.
    • Use placeholders as unique identifiers wrapped in delimiters to mark where dynamic data will be inserted.
    • By default, placeholders use {{ and }}, but you can customize the delimiters.
    • Placeholders must be alphanumeric, contain no spaces, and be unique within the document.

    There are two types of placeholders that you can have in your template document:

    • Single placeholders — These represent one-to-one mappings of text-based data, e.g. {{invoice_number}}.
    • Loop placeholder sets — These are used to insert repeating data like grid rows or multi-option question answers. They’re defined by an opening placeholder starting with #, a closing placeholder starting with /, and placeholders in between.

    Example:

    {{#Loc_array}} {{add_label}} {{add_value}} {{/Loc_array}}

    Here, Loc_array is an array of data, and add_label and add_value are fields within each item.

  2. Add the Document Generation task to your process. Select Configuration > Configure Task.

    Process configuration screen with Document Generation task selected

  3. Configure the general settings.

    • Go to the General Settings tab.
    • In the DOCX document template field, upload your DOCX file template.
    • In the Output Format field, choose PDF or DOCX as your output.
    • Fill in the Start Delimiter and End Delimiter fields.
    • Under Prefills to add to Generated File Name, add the dynamic values to the Name of completed file field. You can add as many prefills as you want. The .docx or .pdf extension will be added automatically based on the output format selected.
    • Click Save.

    General Settings tab showing template upload, output format, and delimiter configuration

  4. Map your data fields.

    • Switch to the MAPPINGS tab.
    • All placeholders from your template will be automatically detected.
    • Map each placeholder to the corresponding data source in your system.

Mapping questions

To map text-based questions — e.g. short text, calendar, search box — map the single placeholders to your desired data source. The image below shows an example of a text-based question mapping.

Text-based question mapping showing single placeholder mapped to data source

Mappings tab displaying detected placeholders and their corresponding data sources

To map multi-option questions — e.g. checkboxes, radio buttons, select list — follow the instructions below.

Checkbox mapping

  1. Map the loop placeholder from your template to the checkbox question in your form. For example, if your template has:

    {{#Loc_array}} {{add_label}} {{add_value}} {{/Loc_array}}

    Map Loc_array to your checkbox question.

    Checkbox question mapping with loop placeholder connected to form checkbox

  2. You can choose whether to display All options (both selected and unselected) or Only Selected options in your output. Make your choice and click Save.

  3. Click the icon to expand additional settings.

Checkbox mapping settings showing All options vs Only Selected options configuration

  1. For the placeholders inside the loop:

    • Map add_label to the option label (e.g. the checkbox text).
    • Map add_value to the selection status (whether the option is checked).

    Loop placeholder internal mapping showing label and value assignments

  2. Under Represented As, choose how you want the checkbox to appear. Then click Save.

Example

Here’s a checkbox shown with all options vs. only selected options in a checkmark/cross format.

Example output showing checkbox options displayed as checkmarks and crosses

Radio button mapping

  • Mapping a radio button question is similar to a checkbox, but it only allows one selected option.
  • Use a loop placeholder as you would with a checkbox, but expect only a single choice to be mapped.

Radio button mapping configuration showing single selection option

Example

Example output of radio button mapping showing selected option marked

Select list mapping

  • To display the selected value as text, map it using a single placeholder just like a text-based question.
  • To show graphical representations (similar to checkboxes or radio buttons), define a loop placeholder and map it like the checkbox or radio button examples.

Select list mapping options showing text display vs graphical representation

Example

Here’s how a select list is mapped with labels only.

Example select list output displaying only selected option labels

How to map a grid

  1. Create a loop placeholder named items in your DOCX template, enclosing all the columns you want to map. Each placeholder inside corresponds to a grid column. For example:
Qty.Item#DescriptionUnit priceLine total
{{#items}}{{quantity}}{{number}}{{description}}{{price}}{{total}}{{/items}}
  1. Map the items placeholder to the grid question in your form. Then click Save.

    Grid mapping configuration with items placeholder connected to grid question

  2. Map each individual placeholder (quantity, number, description, price, total) to the corresponding grid columns in your form.

    For currency fields like price or total, make sure to specify the appropriate currency format.

    Grid column mappings showing individual placeholders assigned to grid columns with currency formatting

To map a footer value such as a total:

  • Add a new parameter for the total.
  • Select the grid question in the Field dropdown.
  • For Which Options, choose Specific Cell.
  • Set Row to footer.
  • Set Column to the column containing the total (e.g. Line Total).

Footer total mapping configuration showing specific cell selection for grid totals

Example of a complete grid mapping

Complete grid mapping example showing table structure with all columns and footer mapped

Troubleshooting common issues

  • Template not detected — Ensure your DOCX file is saved in the correct format and placeholders use the specified delimiters.
  • Mapping errors — Verify that placeholder names match exactly (case-sensitive) and contain only alphanumeric characters.
  • Output generation fails — Check that your Nutrient Document Engine is properly configured and has sufficient resources.
  • Missing data in output — Confirm that all mapped placeholders correspond to actual data sources in your workflow.
  • Template formatting issues — Avoid complex formatting within placeholder text that might interfere with data insertion.

Next steps

After setting up Document Generation:

  • Test your templates with sample data to verify mapping accuracy
  • Configure automated workflows to trigger document generation based on form submissions
  • Set up file storage locations for generated documents
  • Train your team on template creation best practices

Conclusion

Document Generation enables you to automate your document creation process by generating customized DOCX or PDF files. By leveraging placeholders and advanced mapping options — including grid data and footer totals — you can create workflows that produce professional documents for your business needs.

If you’re interested in adding this premium feature to your license or want to learn more about Document Generation, contact our Customer Success team.