Document Editor
Component | Type | Description | |
---|---|---|---|
Document Editor | π action | dynamically generate documents based on a template |
The document editor component allows you to dynamically generate documents using static content and placeholders.
Selecting a document generation modeβ
There are three ways you can generate documents: via the built-in rich text editor, uploading a docx template, or by passing a link to a .docx file via a placeholder.
You select the mode here:
Generate documents using built-in text editorβ
This mode is best suited for simple and quick documents that do not require any complex formatting. You can use static text, insert placeholders, images and perform basic text editing and formatting such as applying fonts, tables etc.
There are limitations to what can be styled and formatting using the built-in text editor. You can copy and paste content from a docx into the text editor directly, but it may not turn out exactly like in the original document.
Generate documents by uploading a .docx templateβ
This method is recommended for more precise styling and formatting requirements. Anything involving additional formatting such as headers, footers, page numbers etc. will require this method.
In this mode, you upload a docx file with the placeholders you want to merge in labelled inside the document itself in the format ${placeholder}. In the example below, the values for ${formSubmittedDate} and ${name.answer} and ${address.answer} merged into the generated document.
Once this docx template has been set up with placeholders inside of it, you simply upload it to the document editor:
Once uploaded, the docx template will be used to generate the document. This mode is best suited to generating documents where rich formatting features found inside word processors such as Microsoft Word are required.
This is what this document will look like when the placeholder values are merged in when the workflow runs:
Generate documents via a placeholderβ
The two methods above require you to set the template of the document to be generated when you build the workflow. However, you may come across use cases where you want to merge in placeholders and generate documents from different templates that are uploaded by users as part of a workflow.
For example, let's say you have a form where user's can upload a contract document:
You want to then merge in values from the workflow into whatever document the user has uploaded (assuming the user has also inputted the relevant placeholders in the uploaded document). You can do this by referencing the placeholder to the uploaded file"
In this scenario, you can use the generate documents via placeholder method. This method involves passing in a link to a .docx template via a placeholder value into the document editor. This placeholder can be generated via an upload file field. This method will download the template from the link, merge in the placeholder values and then generate the document. This allows you to use the document editor to generate documents in a more dynamic manner rather than via a preset template.
Placeholder be a .docx file
The placeholder must refer to a .docx file otherwise the document generation will not work.
Be cautious of the outputs of fields inside of your workflow. For example, the upload file field will generate a .zip file if you upload multiple files into a single field. In this case, the link will not be a .docx file and will therefore fail.
Example use case: create your own e-signature workflowβ
For example, you have a workflow where users can upload their documents and then use the e-signature field to capture and print out signatures into the documents. Users will insert ${signature.answer.html} into the document where the signatures are to be printed, and they then upload this file. The placeholder from this upload field is then passed into a document editor using this method. This will then download the uploaded document, merge in the signatures (and any other placeholders referenced inside of it) and generate the document.
You can download a copy of this workflow πhere
Output file typeβ
You can also select whether the generated document should be a .docx file or a PDF file.
Generate a .docx or PDFβ
The document generated can be saved as either a .docx file or as a PDF.
Where can I find the generated document?β
The document editor outputs a link to the document generated as a placeholder. This can be passed to other components.
Regardless of whether the document editor is connected to another component, any documents generated will be stored in the File Library under the Generated Files tab.