Recipe patterns

Common ways to make your documents dynamic

Conditionally show and hide sections

With Documotor, you're able to customize document content based on specific criteria. You can simply select a portion of a document and determine its visibility by selecting a piece of data that it should depend on.

Illustrations of conditional sections in Documotor recipes.

Here are some common uses of conditional sections:

  • Visibility of portions of terms and conditions, which often depend on the specific type of service performed.
  • Grammatical adjustments, like showing the singular or plural when either of them can occur in the data, like lists of recipients of a document.
  • Showing or hiding given slides of a presentation when necessary.
  • And many more!

For the implementation details, check out the documentation of the Visibility binding.

Organize data

Documotor allows you to manage dynamic content such as repeating sections, including text and tables. Sort, group and organize content to make it presentable.

Illustration of sorting data into tables in Documotor

Whenever data has the structure of a list of objects, you can cycle through list elements and represent all of them. This enables you to create not only simple lists like bullet points, but entire tables and sections. With Documotor, a single placeholder in a template can be replicated to display any number of objects. Here are some examples:

  • Create a balance sheet that features sorting and grouping items into tables. Make a template with a single table and a heading, then repeat the visuals with different data. Specifically, you can group your assets, liabilities and equity. While doing that, Documotor will also enable you to do any additional calculations inside the transformation.
  • Create an invoice directly from the list of items sold and their prices. Even better, group the items by category, and create multiple tables just as easily as a single one. Finally, calculate VAT inside the template - you can even base it on region.
  • In recruitment, automate candidate reports by grouping and displaying positions that a candidate has held.
  • In general, easily display any list of objects where each object needs to be represented in the same way.

Dynamic content gives you more automation power and flexibility when creating your templates. All users are then able to create complex, data-rich, well-arranged, and professional documents with ease from existing data structures.

Insert dynamic sections

Define dynamic sections of documents within recipes to create highly specific documents from generic templates. This enables the production of multiple document outputs from a single recipe, streamlining the process, reducing the need for numerous distinct templates and making management of elements easier.

Dynamic sections in Documotor recipes

The dynamic sections are implemented by inserting other documents, called text elements, into the template. Here's how it works:

  1. Store your text elements in the Documotor unit of your choice.
  2. Store the text element ID's inside a data source.
  3. In the transformation, define which text element is inserted based on input data by keeping an object or data source that maps each data point to a corresponding text element. Your text element can be a dynamic recipe as well, in which case you can pass the necessary data to it as well.
  4. Inside the template, insert the binding in the place where you want to insert the dynamic section.
  5. Generate the output document to find the text element inserted into your main document.

Structuring the documents in this way makes content management simpler and allows administrators to manage different sections independently. It also allows you to reduce the number of templates, by condensing similar templates into one. Furthermore, the text elements are reusable across documents, once again simplifying your document management.

Automation power

It's possible to completely automate highly complex documents by combining these patterns, and using many other ones. Entire sections of a document can be conditional, including images, charts, tables, and other content types. In this way, a single Documotor recipe can replace many conventional templates.

The logic of creating a document.

The logic of creating a document, with the result on the right, and the dynamically chosen elements in orange.