Skip to main content
Skip table of contents

Author a Template


After you create your template, you can author its content. This page walks through the steps.

Authoring the Content of a Template

To author the content of a template, click the EditTemplate button. The TemplateBuilder window will open, where you will be able to edit the text and appearance of your template as if it was a Word Document, or like you would edit an email. The TemplateBuilder is divided into two sections: The menu bar and the template body.

The Menu Bar

The icons allow you to specify heading and paragraph styles, the font typeface, and font size, bold, italics, bullet points, and justification. You can build tables, insert graphics, and spell check. You can even start your template in Microsoft Word, copy it there, and use a special Word Paste icon on this page to insert your text in this editor.

Developer Tip

If you are looking to update the raw HTML, the Source button will allow you to examine the editor window as raw HTML. If you make changes in the raw format, on save, the editor will revise your work to remove any nonconforming tags or attributes. In general, it’s best to work in the WYSIWYG view. You can make light edits to the arrangement of <div> tags and &nbsp; entries.

Adding Merge Fields to a Template

Nimble Create allows you to pull in data from Salesforce and insert it into the template. It works exactly like a Word Merge, except you can do all the steps in Salesforce without exporting data from Salesforce to Word.

  1. From TemplateBuilder, click the Insert Field picklist to see a list of merge fields available to you.

    This list reflects the SOQL query SELECT line from when you first created the template. If there is a field you need in your template but it isn’t listed in this list, save the progress you’ve made within the template. Close the TemplateBuilder, update the SOQL SELECT line in your SOQL Query and re-open the Template. 


  1. Select the fields from the drop-down (one by one) and add them to your template.

  2. Click Save. 

When using a value from a Lookup field, ensure that you’re pulling the value that you want through the lookup (ie, do not use {!Account}, use {!Account.Name}. Do not use a merge field for the lookup itself.

Insert a Page Break

Sometimes your template may contain information for multiple records or span multiple printed pages. You can use a page break to show where in the template you would like the information to start on a new page. To do this, from TemplateBuilder, click in the body where you would like the page break to occur, then click 

.

Insert a Graphic

You can attach any sort of graphics, such as a logo or picture into your template. Graphics within a template require a URL for that image. We recommend storing your images within Salesforce as a Document record. This will ensure that your image URL won’t change. Follow the steps below:

  1. Go to All Tabs → Documents
  2. Create a New Document and upload the file.
  3. Get the URL of the file
  4. From TemplateBuilder, click 
    .
  5. In URL, enter the URL of the Image from the document.
  6. In Alternative Text, enter the text to display if the image does cannot be rendered.
  7. Click OK.
    The image should now appear within body of the TemplateBuilder.


Some images do not render correctly when creating a PDF from a template.

Image Sizing

We recommend that the URL for your image is the proper size of image. While you can modify the size of the image within the TemplateBuilder, there may be times where the image size reverts back to the original size of the document.

Insert a List

There are two types of lists you can add to your template:

 Ordered: Will put the records from the template into a numbered list. Each record will display on a new line.

 Unordered: Will put the records into a bulleted list. Each record will display on a new line.

  1. From TemplateBuilder, click where you want to insert your list, and click the ordered or unordered list icons from the menu bar.
  2. You can enter your list into the template manually, if you are not using fields from your SOQL Query. 
    Note: If you want to use fields from your SOQL Query to populate the list, then, you must use a Repeat Panel and the SOQL query must include a SubSelect statement to pull in the records you wish to display within the list. 
    Sample SubSelect SOQL Query:
  3. Click Save.

Insert a Repeat Panel

A Repeat Panel allows you to populate a list, or a table with records from the SubSelect statement in your SOQL Query. A SubSelect statement is required to use the repeater panel.

  1. From TemplateBuilder, click in the body of the template where you want the repeat panel to occur and click 
    .
  2. The Repeat Properties window will appear.
  3. In Related Object, enter the field used in the FROM clause in the SubSelect statement of your SOQL query.
  4. In List Style, enter:
  1. OL - For an ordered/numbered list.
  2. UL - For an unordered/bulleted list.
  3. Leave blank - For no indenting 

  • Click OK.
  • The Repeat Panel is added to your template. You can enter text and fields from the Insert Fields picklist as needed. 
    Note: Fields from the SubSelect query should only be used within the Repeat Panel. Using these fields outside of the Repeat Panel will cause the fields not to be populated.
  • Once the Repeat Panel is populated, click Save.

Edit a Repeat Panel

If you need to edit a Repeat Panel, right click the panel and click Edit Repeat. select Repeat Properties. The Repeat Properties window will open. Make any changes and click OK.

Insert a Table

You can insert a table into your template to organize multiple records to ensure they are organized and easy to understand.

  1. From TemplateBuilder, click where you want the table to be and click 

    .

  2. The Table Properties window will appear. Populate the fields as listed below.

  3. Rows - the number of rows you wish to display. Exception: If you are setting up a table to loop over multiple rows: if you would like headings on your table, type 2, otherwise type 1.

FieldValue
ColumnsThe number of columns you wish to display
Width

The width of the table can either be represented in pixels or percent. If no % is used, the table will be the width of the number of pixels entered. If the % is used, the table will be that percentage width of your template.

HeadersIf you would like headings on your table, select First Row from the drop-down. You can also choose to have the First Column set as the header row of the table.
Cell SpacingThe spacing, in pixels, between cells within the table. We recommend 0.
Cell PaddingThe padding, in pixels, between cells within the table. We recommend 2.
Border Size The width of the border, in pixels, that you want to display for the table. We recommend a border size of 0 or 1.

0: To be used when you don’t want to show the borders of the table.

1: To be used when you want the borders of the table to display.

Caption

has no effect on the template.

Related Object

The Related Object is the WHERE clause in the SubSelect as specified on the SOQL entry for the template.

If you specify no Related Object, then the table will not look to another object to populate the data within the table.


You can put merge fields into the table to organize your data. You can even insert an “invisible table” to allow you to format items on the page according to columns.

Loop a Table Over Multiple Records

A table can loop over multiple records in Salesforce and use that data to populate the table. To achieve this, the SOQL query must include a SubSelect statement. The fields queried in the SubSelect statement can be used to populate the table. If your table is looping over multiple rows, only insert merge fields into the Table that match the Related Object. When the template is rendered, the table will expand to include all records that are queried in the SubSelect statement of the SOQL Query:

Insert a Conditional Render Panel

A render panel allows you to conditionally render a section of the page based on data you are querying in your SOQL query.

  1. From TemplateBuilder, click 
    . The Render Panel Properties window appears.
  2. In Render If, enter the field(s) from the SELECT statement in your SOQL query that you want to use to control the render panel, a comparison operator (<, <=, >, >=, =, etc.), and a value

    The syntax of the Render If field is a bit unique. It will resemble a SOQL SELECT WHERE clause, so the format of the field should match the field as it appears in your SOQL Query, not as the field appears within the template. If you are copying the field from the template, be sure to remove the curly brackets, { },  exclamation points, !, and the original object queried.

    Example...
    Field in SOQL QueryMerge Field Inserted into TemplateRender If field with Proper formatting
    NU_Balance__c{!NU__Order__c.NU__Balance__c}NU__Balance__c>0
  3. Click OK.

  4. A render panel is added to your template. Click within the panel and update as needed to match the detail you wish to display when the record’s data meets the criteria to render.

  5. Once added, the render panel will appear with a grey background. Any text added within the Render Panel will only be rendered when the criteria is met.


In the example below, we create a render panel to add a remittance slip to an Invoice only if the balance of the order is greater than 0.

Render If Details

  • You may choose to skip the Render If section and come back to it later, if you need to. If you skip it, the render block will always render.

  • You can compare a field to a number or a string constant, but not to a date or another field.

  • You can have more than one criteria in the Render If field. These can be joined by the words “AND”, “OR” and parentheses to accomplish complex renderings:
    Example: Criteria1 AND (Criteria2 OR Criteria3)

  • Developer Tip: The render panel is enclosed by <div> tags, displaying it as a block by default. It’s possible to convert the render panel to be an in-line string by editing the source and removing the <div> tags.

Edit Render Details

If you need to edit a Render Panel, right click the panel and click Edit Render Panel. The Render Panel Properties window will open. Make any changes and click OK.

JavaScript errors detected

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

If this problem persists, please contact our support.