Dynamic sections

Insert one document into another.

With Documotor, it's possible to insert an entire document into a template. This is useful when large pieces of content are inserted conditionally, e.g., when a Terms and Conditions section depends on the data that populates the template. This is done by using the TextElement binding.

TextElement

Inserts an existing document into the template. This document is usually referred to as a text element. It can be a template and will be generated with the current scope as its starting scope. The entire paragraph of the Content control will be replaced, so it is recommended that the binding is on a separate line in the template.

Parameters

{
  "BindingType": "TextElement", 
  "BindingKey": "FilePath", 
  "KeepTextElementTogether": "KeepString",
  "Inline": "InlineString"
}

string BindingType

Always "TextElement" to invoke the TextElement binding.

JSON path FilePath

A path to a string which is either a base64 string or a public URL that can be used to download the text element. Some data is automatically be passed to it to populate its bindings. The scope of the data that's passed will be the parent object of the key containing the text element value, e.g., below, if the TextElement binding key is textElement, the entire object below will be the scope that's passed as sample data to the text element.

{
  "textElement": "123d43ada87098ecbase64",
  "title": "Example Dataset",
  "name": "Jane Doe"
}

πŸ“˜

The text element is often provided by an external service, data source, or by using the template function, which generates a document from a Documotor recipe and outputs it as a base64 string.

string KeepString

String that sets the "Keep with next" and "Keep lines together" properties in Word. If KeepString is equal to true, the properties are enabled for each paragraph in the text element. For other values of KeepString, including leaving the field empty, the properties are disabled. "Keep with next" keeps the following paragraph on the same page as the current one, while "Keep lines together" prevents page breaks within paragraphs.

string InlineString

If InlineString is equal to true, copies the content of the text element into the main document instead of embedding it. This option is recommended when outputting PDFs, for a smoother experience. Other values of InlineString, including leaving the field empty, insert the text element as an embedded Word document. This option is recommended when outputting a Word document.