This is the reference page for all the Elements you can use in Maven Documents DOCX templates. For every element, you can check out basic information, the full list of attributes, and the following specifications:
selfClosing – represents whether the element is closed immediately. Such an element has the self-closing tag ('/') to effectively close out a beginning tag enclosed in sideways carets. In opposition to standard HTML tags, which have both opening and closing tags
There are also basic attributes that every element has:
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
name | string | Name of the element. | false | - | false |
hidden | picklist | Determines if the element is visible. | false | - | true |
The Expression column indicates whether an expression can be used as that attribute's value.
The iteration component is similar to the Table element. But Repeater allows outputting the content of a collection according to a structure that you specify because the whole body of the Repeater element will be shown for every record in the collection. This element can have other elements, like Table, Paragraph, or Image, nested inside.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
value | picklist | Collection of records to use in Repeater. | true | - | false |
variable | string | The current record in the iteration. | true | - | false |
mode | picklist | Repeater mode - Standard or Append. | false | standard | true |
Notice the # (hashtag) used. It wraps around item and op Variables referenced inside Repeater and Table.
The example above generates something like this (as you can see, Repeater has the Table and Paragraph elements nested inside):
If you would like images to be "appended" by side to each other - use the Repeater's Append mode :
So if you have two images linked in the Description field on the Contact object, the result would be something like this:
There is also a possibility to use Index Expression inside the Repeater. This expression returns the index of the repeating variable inside the Repeater.
This element inserts a table that's defined by iterating over a collection of data, displaying information about one item per row. The body of the element contains a table in which one row is to be repeated through the iteration, as the element will add as many rows as there are records in the collection.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
value | picklist | Collection of records to use in the table. | true | - | false |
variable | string | The current record in the iteration. | true | - | false |
repeatingRow | integer | The index of the row is to be repeated. | false | 1 | true |
rows | integer | The number of rows to be in the table. | false | 2 | false |
columns | integer | The number of columns to be in the table. | false | 2 | false |
Notice that the # (hashtag) sign is used. We must place # before and after any Variables referenced inside Tables and Repeaters.
The example above generates a table like this one (it will expand with as many rows as there are records):
There is also an option to use the Index expression inside the Table. This expression returns the index of the repeating variable inside the Table.
Just place the cursor inside the Table and insert the Index expression in the selected place.
Use the Paragraph element if you would like to show/hide the entire section of the document.
In the example above, the Paragraph will only be shown if Opportunity.IsClosed field is false. Otherwise, it will be ignored.
If you want to hide the last paragraph in the template, make sure that it ends with an empty row. Otherwise, it could throw an error when generating the document.
This element allows you to render an image from the specified URL or use base64 data.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
source | picklist | Allows to select the merge field that holds base64 data or the URL of the image. | true | - | true |
width | integer | Width of the image in pixels. | false | - | true |
height | integer | Height of the image in pixels. | false | - | true |
The example above will render the image from the URL that's in the Account's Description field. Width will be set to 200px, while height will be adjusted to keep the aspect ratio.
Rich Text is used to insert the Rich Text Area field in the document. You would first need to add such a field to the query in the Query Builder tab of Maven Documents. You can then create an element as shown below.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
value | picklist | Allows to select the merge field that holds the rich text. | true | - | true |
Renders different types of codes, like QR Codes, Barcodes, etc., into the document.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
type | picklist | Code type. | true | - | true |
value | picklist | Allows to select the merge field that holds a textual value that will be replaced with the code image. | true | - | true |
scale | integer | The scale of the rendered code. Must be an integer > 0. | false | 2 | true |
rotate | picklist | The list of available options which define the rotation of the code image to one of the four orthogonal orientations. | false | N | true |
includeText | boolean | Displays text below the code for some code types (e.g. code128). | false | false | true |
<mdoc:code name="qr" type="qrcode" value="{!Opportunity.Account.Name}" />
The example above will render the QR code with the Account's name as the code value.
The Page Break element is used to dynamically render a page break into the document.
<mdoc:pageBreak hidden="{!Opportunity.IsClosed}"/>
The example above will dynamically render a page break into your document.
Use the Text element if you want to show/hide only the inline part of the text. The body of the element contains text that will be shown/hidden.
In the example above, the inline text will be shown if the Opportunity.IsWon field is false. Otherwise, it will be ignored.
The Link element renders a hyperlink into the document. The body of the element contains the text of the hyperlink, while the URL is defined in the attribute.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
URL | picklist | Allows to select the merge field that holds the URL. | true | - | true |
The example above will create the Link element with the URL stored inside the Opportunity.Description field.
This element can only be referenced inside the Table element. Its purpose is to hide rows of a Table based on some criteria.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
hidden | picklist | Defines if the row will be removed. | false | - | true |
indexes | string | Comma-separated row indexes that will be hidden if the Hidden attribute is true. | true | - | true |
Keep in mind that the Hidden attribute here has a different meaning from the one we mentioned at the beginning of this page. This Hidden attribute references if the row (column) will be removed, but not elements themselves.
The Table Column is similar to the Table Row element. The only difference is that Table Column hides columns instead of rows.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
hidden | picklist | Defines if the row will be removed. | false | - | true |
indexes | string | Comma-separated column indexes that will be hidden if the Hidden attribute is true. | true | - | true |
This example will include both Table Row and Table Column as they are similar in definition and it is most likely that you would use them both at the same time.
The coordinates of the cells are (row/column). Numbering starts from zero.
In the image above, colored rows on indexes 1,3,10, and 11 should be hidden. Only the second column on the index of 1, should be hidden as well.
Here is the result:
Notice how the overall table width stayed the same.
The element allows you to take elements from another template or the template itself and use them to build a new unique document.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
source type | picklist | Provides a choice of the content type. | true | - | false |
source | text/picklist | Provides a list of available templates or document instances. | true | - | false |
element name | picklist | Available only if the Content Type is Document Template. Provides a list of elements from the template. | true | - | false |
The Include element below will insert the element called RichText from your Template DOCX Document Template into the template you are working on.
There's also an opportunity to insert the whole content of the document from the template you've chosen. For that purpose, you can use the Salesforce File Source Type. You can select the Include the Whole Document option in the Source attribute for the Document Template Source Type.
Due to Microsoft limitations on online DOCX files, you currently can't select a specific element from the needed Document Template. Once you choose the template in the Source field, you get a warning message.
However, if you close the message and insert the Include element into your document, you will include the whole content of the selected Document Template. If needed, you can manually add the needed element from the Document Template by putting theelementName="The Name of the needed element"
attribute into the body of the inserted Include element.