After you have created a new document message, you can upload an existing .docx to create your automated document. We’ve broken down this process into a few key steps:
- Upload your document
- Insert variables
- Edit content
- Apply rules
- Export or test
- Set document expiry (optional)
1. Upload your document
You must upload a .docx that is <10MB.
You can drag and drop your .docx into the Add document pop-up, or use the Choose file button to select a .docx. Once the upload is complete, select the purple Edit document button. A new tab will open with the document editor.
Your uploaded document will appear as editable blocks of text in the document editor. Your styling is saved, but only certain elements appear in the document editor.
You can use the Export button in the top right corner to view the styling of your document, which will include any edits made to the spacing, text and text styling.
2. Insert variables
To insert variables from users in your document, place the cursor where you want the response to appear and then click on the Insert response button on the purple toolbar.
Select the relevant message and, once they’ve been inserted, they’ll appear as the name of the message in purple text.
You will not be able to insert variables if the document is not connected to your conversation flow.
Inserting file uploads
When you select a file upload variable to insert into your document, you can choose whether to display the file as a link or an attachment.
Image files (limited to .png and .jpg) uploaded by a user can be displayed as a link or embedded inline in your document.
Document files (limited to .docx) can be displayed as a link, or attached to your document as an appendix. To attach a document as an appendix, simply insert the variable at the end of your document. A .docx file uploaded by your users that is inserted as an attachment will be appended to the end of your document.
All other file types will be displayed as a link in your document.
3. Edit content
You can edit the content of the document you uploaded in the document editor. Simply type where you want your text to appear.
You can delete or duplicate entire blocks of text by selecting the block and using the icons in the floating toolbar.
You can bold, underline or italicise words. Highlight the text and use the icons in the top left hand side of the editor. You can also apply the usual keyboard shortcuts for these functions.
You can copy the formatting from one text block and apply it to another block using the format painter tool. If you’ve ever used the format painter in Microsoft Word, it’s exactly the same!
If necessary, you can re-order text blocks in your document. Simply focus on the block, and press the up or down icons in the floating toolbar to move the block.
If you've used looping logic in your bot, you can insert looped variables into your document. Learn how to do this in our article on looping logic.
Some content will not be displayed in the editor, or will be uneditable.
This content, such as cross-references and images, will be produced in the automated document after it has been uploaded and edited in the Word editor.
You may see grey text blocks in the Word editor which contain unsupported content. If you want to edit this content, you can learn how to do that in our article on unlocking unsupported content and blocks.
4. Apply rules
Rules allow you to determine when text will appear in the document that is generated by your bot.
In this section, we will outline how you:
- Select the text you want to apply a rule to
- Apply the rule
- Apply the All/Any toggle
- Edit and delete rules
Select the text you want to apply a rule to
You can apply rules to individual characters or words by highlighting the text and selecting the Add text rule button in the middle of the purple toolbar.
You can apply rules to blocks of text (denoted by their pale purple border) by clicking anywhere in the block and pressing the Add block rule button. The border will turn dark purple when the block is selected. You can apply a rule to multiple blocks of text if you highlight them.
Apply the rule
You apply rules in the Word editor in a very similar way to creating connections and rules between messages.
Once you have selected the block or text, click the Add rule button in the purple toolbar. A purple sidebar will appear. Press Add rule to apply a rule to determine when the text will appear.
If a particular clause should only appear if the user has told you that the term of an agreement is greater than two years, you would select the following from the fields that appear:
- Message: Term in years (the name of the message)
- Operation: is greater than
- Response: 2
When you’re done, click out of the sidebar. It will save automatically!
Once a rule has been applied, it will be highlighted in blue! You can edit it by clicking the blue text and selecting the Edit rule button.
Applying multiple rules
You can add as many rules as you like to the text. To do this, just click the Add rule button again. If you do create more than one rule in the same connection, you will need to be aware of how the All/Any toggle works (see below).
Applying Groups of rules
You can also apply Groups of rules, where two or more rules need to be satisfied for the logic to be applied.
To do so, after creating a connection, select Add group rather than Add rule in the sidebar. The group will expand and you will be able to add the rules that you would like met, in the same way as detailed above. Be mindful of the All/Any toggle!
For ease of reference, you can rename your group. Simply click on the name of the rule once it has expanded - the place where you add rules - (for example, "Group 1"), and edit the text.
Apply the All/Any toggle
The All/Any toggle appears at the top of the rules sidebar.
If you have created more than one rule and you select "any", then if any of those rules are satisfied, it will connect to the connected message.
If you select "all", then all of those variables must be given before it connects to the connected message.
It’s like using “And” or “Or” in a Boolean search when you’re doing legal research.
Edit and delete rules
Click on some text which is highlighted blue. Select Edit text rule in the purple toolbar and the purple sidebar will appear.
You can edit or add rules to the text. You can also delete rules for the text using the rubbish bin icon.
You can also edit the content in your text on the page, even if you have applied a rule to it. Just type in the text and click out of it with your mouse when you’re done.
If you want to see if you’ve applied everything correctly, test your bot.
5. Export or test
You can see how your document will look like by clicking the Export button in the top right hand corner of the document editor.
First, review the Word/PDF toggle in the top right hand corner of the Word editor to choose whether you want your bot to generate a Word document or a PDF document.
When you click Export, you will download a copy of your document in the format you selected and you will be able to view the variables you inserted and rules that you have applied to the document.
Or, you can navigate back to the dashboard, select Preview in the bottom left hand corner, interact with your bot, and see how your bot produces the document.
6. Set document expiry (optional)
You can set an expiry period for generated document links by selecting the checkbox located within the message sidebar. If this feature is enabled, the links generated for that document will expire in 45 days after the document is downloaded the first time. This will also apply to previously downloaded documents within the bot.
This feature is only available for documents generated using our Word editor.