This is the reference page for all the elements you can use in the Maven Documents Google Docs templates. For every element, you can check out basic information, the full list of attributes, and the following specifications:
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 |
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 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 the Index expression inside Repeater. This expression returns the index of the repeating variable inside 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 the table like this one (it will expand with as many rows as there are records):
There is also a possibility to use the Index expression inside Table. This expression returns the index of the repeating variable inside Table.
All you need is to place the cursor inside 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, Paragraph will only be shown if the 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 the 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 |
You can have a URL of the image as the source for the image. Here how it works:
Fill the Salesforce field with the URL of the image.
Insert the field into the document using Template Builder.
Generate the document and get the content of the field rendered into the image.
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.
You can have base64 code as the source for the image. The procedure is the same:
Insert the field into the document using Template Builder.
Generate the document and get the content of the field rendered into the image.
The example above will render the image from the base64 code that's in the Account's Description field. Width will be set to 200px, while height will be adjusted to keep the aspect ratio.
If you wish, you can put the URL of the image or the base64 code straight into the element in the document.
The outcome will be the same as with the merge field.
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 that defines 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 the 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 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 is referencing if the row (column) will be removed, but the elements themselves.
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 | text/picklist | Provides a choice of the content type. | true | - | false |
source | picklist | Provides a list of available templates or document instances. | true | - | false |
element name | picklist | Available only if Content Type is Document Template. Provides a list of elements from Template. | true | - | false |
The Include element below will insert into your document the element called RichText from the Test Template Docs0 Document Template.
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 Google Doc Source Type. Or you can select the Include the Whole Document option in the Source attribute for the Document Template Source Type.