Skip to main content

Document Editor

ComponentTypeDescription
imgDocument EditorπŸ”€ actiondynamically 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:

img

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.

img

note

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​

note

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.

img

Once this docx template has been set up with placeholders inside of it, you simply upload it to the document editor:

img

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:

img

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:

img

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"

img

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.

important

Placeholder be a .docx file

The placeholder must refer to a .docx file otherwise the document generation will not work.

caution

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

img

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.

img

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.

img