Add your Templates to Box for use with Box Doc Gen
The only file type compatible with Box Doc Gen templates is a Word (.docx) file. To use a .docx file as a Box Doc Gen template, it must be configured with Box Doc Gen template tags, which is placeholder text for dynamic content to be automatically populated as part of the document generation process.
When a document generation process takes place, the pre-configured Box Doc Gen template automatically identifies the Box Doc Gen tags within the template, matches the tags with the fields in the JSON input data, and replaces the tags with the appropriate data to dynamically generate a document.
Box Doc Gen templates must be uploaded to Box first to properly generate documents.
Prerequisites
To add your Box Doc Gen template to Box, you must create and author your Box Doc Gen template in Microsoft Word. You can use one of the following approaches to create and author your template:
- Use the Box Doc Gen Template Creator add-in for Microsoft Word to create a Box Doc Gen template without any code.
- Use the Box Doc Gen tagging script to author the template.
Marking an existing document in Box as a Doc Gen Template
You can leverage an existing .docx file within your Box account as a Box Doc Gen template by marking it as a Box Doc Gen template. To mark an existing document as Box Doc Gen template:
- Right-click the .docx file to open the menu.
- Choose Mark as Doc Gen Template.
The file will be marked as a Box Doc Gen template and will be ready to be used to dynamically generate custom documents.
Note: You can access the template from the folder where it is stored, and the Doc Gen tab in Relay.
To unmark the template:
- Go to Relay > Doc Gen.
- Hover over the template you wish to unmark and select the ellipses
. Select Unmark Template
3. The template will be removed from the Box Doc Gen template list. It will still be available as a regular .docx file in the designated save location folder
Creating a new Box Doc Gen Template from scratch
To create a new Box Doc Gen Template to Box:
- Navigate to Relay > Doc Gen
- In the new window, click New file.
- Provide a name for your template.
- Specify the destination folder where the template will be stored.
- Click Create. A new Box Doc Gen template will be created in the provided folder and automatically marked as a Box Doc Gen template. It will also be visible under the Doc Gen tab in Relay.
Creating a Box Doc Gen Template from an existing file
To upload an authored Box Doc Gen template to Box:
- Navigate to Relay > Doc Gen.
- Click New > Doc Gen Template.
- In the new window, click Existing file.
- Select to either Choose from Box or Upload File.
- Specify the destination folder where the template will be stored.
- Click Create. The template will be added to the provided folder and automatically marked as a Doc Gen template. It will also be visible under the Doc Gen tab in Relay.
Viewing Box Doc Gen Template activity
If your template was used to generate a document, you can view a list of document generation activity and access the generated documents.
To view the document generation activities:
- Go to Relay > Doc Gen.
- Hover over the template you want to check and select the View Activity button.
A new view shows the time the generation request was processed, its status, and a link to the generated document.
Document generation status
The available status values for a generated document are as follows:
- Submitted: Document generation was requested.
- Completed: Document generation succeeded.
- Completed with errors: Document generation succeeded but there were some errors on the way.
- Failed: Document generation failed.