How do you enable your end users to automatically create documents? Learn how to build a self-service solution, where end users can answer questions and generate documents, such as contracts or documentation.
This image illustrates the transition from template to self-service document. The placeholders in the template will be replaced by text generated in response to user answers.
How to build a document generation process
To automate document generation:
1. Prepare a template in MS Word
- Create a new template in MS Word or open an existing template document.
- Populate your template with placeholders (wrap text in double curly braces, like {{effective_date}}.
2. Upload your template in a Create Document Action Node
- After constructing your questions, add a Create Document Action Node to your module.
- Upload the template document in the Document Action Node. A list of all placeholders in the document will display.
- Confirm that each placeholder will be replaced by the correct variable.
3. Make the document, created in the background, available to your end user
- You can disseminate the generated document in different ways: Attach it to an email, download it in an Input or Result Node, or transfer it to a Case Database.
More complex document elements
In practice, building an automatic document generation solution can present challenges. You may want to add more complex elements to a template. Or, the results of document generation are not what you expected. We have outlined some of the most common challenges here:
I want to add particular text blocks to my document (e.g., contract clauses), based on the end user’s answers
You can update Text Block Values to make the content of a text block depend on your end users answer, or to be blank if need be. For very complex document templates we advise adding conditional content to your template directly.
I want to add a table to my document
The most common way to do this is to collect data in a collection and then turn the collection into a table. If your data is in non-tabular format, you also can put your placeholders in a table and configure the table manually.
I want to give the end user a preview of the generated document
Use Document View.
Some end user answers result in empty lines in my document
You can include additional "deletion" commands in your template.