Skip to main content
Skip table of contents

composeContent

Evaluates the content commands in the defined document part or an external document. A Flow does not automatically evaluate logic in the template's document content, so this command must be used in order to produce dynamic document content.

The template attribute defines the document content to evaluate. There are three types of valid resolved values for this attribute:

  • A DAP Part causes the content of that Document or Email part to be evaluated. Use the DocumentProperties variable doc to get the Part you need. For example:${doc["Body Content"]}

  • A String value should be a path pointing to a HTML document within the template's archive file - this is the document whose content is evaluated. For example:"Cover Page/content.html"

  • A File value. The file may be an HTML template, whose content is then evaluated.

The result of the evaluation will be a File value. The name of the file in the case of Online templates' HTML documents will be the title of the document.

To evaluate content of Word, PowerPoint and Excel templates containing Word, PowerPoint or Excel content commands, use the composeDOCXContent, composePPTXContent and composeXLSXContent commands instead.

var

 

 

Required

Value type

EL-evaluated

Yes

String

No

Defines the name of the variable placed into the variable context whose value is the evaluated HTML document.

template

 

 

Required

Value type

EL-evaluated

Yes

DAP Part, File, String

No

Defines the template whose body content is evaluated. The resolved value may be a DAP Part, a String or a File, as described in this command's documentation.

displayEmptyValues

 

 

Required

Value type

EL-evaluated

No

Boolean

No

If this attribute resolves into true, the HTML content commands content and model will output empty String values if their primary attributes resolve into such. Normally they treat an empty String as a undefined value and will not affect their host element in any way.

editable

 

 

Required

Value type

EL-evaluated

No

Boolean

No

If this attribute resolves into false, any HTML content commands that are capable of making their contents editable will not do so, regardless of their own attribute values. This may also affect other behavior of HTML content commands, which will then be mentioned in their documentation.

The resolved value of this attribute is available to all the evaluated content commands with the variable name "composeContent_editable".

Default value is true.

importResult

 

 

Required

Value type

EL-evaluated

No

Boolean

No

This attribute can be used to control what a content HTML content command produces when it imports the Online template this command is in.

If this attribute's value resolves into true, then the product of this command will appear instead of the product of some other composeContent command in the same Flow.

inlineStyles

 

 

Required

Value type

EL-evaluated

No

Boolean

No

If this attribute resolves into true, the CSS properties applying to each element in the composed HTML document are written into their "style" attributes. This "inlining" of the styles makes the HTML more suitable to be used as email content, but will increase the size of the file and in certain cases also cause appearance-changing style interactions.

If not defined, value of false is used.

retainBound

 

 

Required

Value type

EL-evaluated

No

Boolean

No

If this attribute resolves into true, no HTML content commands of the "bound" series, such as bound-content and bound-if, are evaluated. The unevaluated commands will remain in the composed template, and should the composed template be composed again with this attribute as false, will then be evaluated normally.

If not defined, value of false is used.

The composeContent command is a fairly common sight in Flows and often used in this basic way to produce composed document content.

CODE
<composeContent var="composed" template="doc['Document']">

Should you have a need to produce multiple versions of a document within the Flow, it can be done without much complications by using composeContent several times while switching the data rendered in the document between the composings. This is a fairly necessary thing to do if your Flow contains a Screen in which the user can edit the document - the document has to of course be composed before the Screen, but also after it to recreate the composed document File so that it has the user-made changes in it.

Here's an example of producing a Collection of composed documents with a loop of record IDs:

CODE
<setCollection var="composedDocs">
<forEach value="${productIDs}" var="productID">
  <record var="product" type="Product2" recordID="${productID}" fields="Name, ProductCode">
  <composeContent var="composed" template="doc['Product Sheet']">
  <addItem value="${composed}" collection="${composedDocs}">

If this Flow is part of a template that exists to provide content to import into another template's body with the HTML content command content, the importResult attribute can be useful. If this Flow has multiple result documents produced by composeContent, only one of them can be imported and thisa ttribute defines which. Just ensure its value resolves to a Boolean true for the result you wish to import.

CODE
<composeContent var="notImported" template="doc['Blank Document']" importResult="${false}">
<composeContent var="imported" template="doc['Special Document']" importResult="${true}">
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.