Manage Templates

Templates are starter Documents admins define so users can create new Documents quickly. Templates support Record Link, Live Field, and Related List placeholders that get resolved from the Source Record when a Template is instantiated to create a new Document.

Manage Templates in the Folio Admin page under the Document Templates section.

Access existing Templates

Access existing Templates in the table. From the right utility buttons on each row, you can:

  • Edit the Template
  • Clone the Template
  • Delete the Template
  • Copy the direct link to the Template (share with another admin)
  • Copy the ID of the Template (you will need this if you want to automatically instantiate the Template from invocable Apex; see the Automate with Invocable Apex page for more details on this).

Only users with the Folio Administrator permission set can create, edit, or delete Templates. End users cannot create Templates; they can only instantiate Documents from Templates that an admin has already created.

Template editor

You open the Template editor by clicking the pencil Edit icon on any Template row, or by clicking New Template to start one from scratch. It works just like the Document editor, with a few additions specific to Templates.

The most important addition is the Source Object selector at the top of the editor header. Every Template must have a Source Object — it tells the instantiation process which records are valid as the Source Record for a new Document created from the Template. Even if the Template contains no Record Links, Live Fields, or Related Lists, the Source Record is still required: it becomes the default linked record on the new Document.

When a Template is instantiated, every Mention in the body (Record Links, Live Fields, Related Lists) is resolved in real time against the chosen Source Record, and that record is automatically linked to the new Document.

Creating a new Template

When creating a new Template, keep the following in mind:

  • Give your Template a descriptive Title. It’s what users see when picking a Template to create a Document from. New Documents are named {Template Name} for {Source Record Name} (e.g. “Account Plan for Acme Inc.”), so avoid putting “template” in the Title — the resulting Document name reads more naturally without it.

  • Optionally add Related Records or Tags. Whatever you set on the Template is applied to every Document instantiated from it.

    • Tags are the common use: label Templates with Tags like “Account Plan” or “CS Handoff” so users can filter for them in Folio Home.
    • Related Records is rarer but useful for static context — e.g. a Template only used for one key Account can be set to always link its Documents to that Account.
  • Templates support the full Document editor’s formatting — headings, bullet/numbered/task lists, quote blocks, code blocks, images, horizontal rules, tables, and hyperlinks. Use / commands, keyboard shortcuts, or markdown shortcuts the same way as in a Document. See Format with Slash Commands and Use Keyboard Shortcuts for details.

Mentions

Mentions are the placeholders inside a Template that get resolved against the Source Record when the Template is instantiated.

Mentions can be added into a Template using the picker fields at the top of the page. The @ shortcut for inserting Mentions does not work inside the Template editor — it only works in the actual Jot and Document editors. In the Mention Picker, you select one of three Mention types:

  • Record Link
  • Related List
  • Live Field

When Record Link or Live Field is selected, the formatted Mention syntax appears to the right of the picker, ready to be copy-pasted directly into the Template body.

When Related List is selected, a Related List Picker dropdown appears, where you select the child object and the specific lookup relationship the Related List should be rendered from. Once selected, the correct Mention syntax appears to the right and can be copy-pasted.

Visual confirmation: As soon as a Mention’s syntax is completed with the opening and closing curly brackets — {!$___} — it automatically turns into a blue chip in the Template body, indicating that the syntax has been recognized as a Mention. If your text stays as plain characters and never converts to a chip, the syntax isn’t valid yet.

Manual entry (advanced)

Admins do not have to use the pickers; they are there as a helpful guide. Admins can also manually type in Mention syntax directly. This is more advanced, and admins are responsible for entering the syntax correctly. If a manually entered Mention does not match a configured Linkable Object and Live Field, the Mention will not resolve when the Template is instantiated.

Any Mentions that fail to resolve when a Template is instantiated will be displayed as plain text and highlighted with a red background in the resulting Document, making them easy to spot.

For this reason, it is recommended to always use the picker to insert Mention syntax into a Template, unless you have a specific need to use multiple levels of dot notation (see below).

Always test your Templates to ensure all Mentions are resolving correctly before announcing them to your users or embedding them in an automated process.

Syntax reference

Record Link: {!$Object.Id} — where Object is the API name of the Source Object.

Related List: {!$ParentObject:ChildObject:LookupRelationship} — for example, to display a Related List of Cases under an Account, you would write {!$Account:Case:AccountId}, where Account is the Source Object, Case is the child object, and AccountId is the lookup relationship the Case uses to look up to the Account record.

Live Field: {!$Object.Field_Name__c} — where Object is the API name of the Source Object, and Field_Name__c is the API name of the target Live Field.

Multiple levels of dot notation (advanced)

As an advanced feature, multiple levels of dot notation are supported in Record Link and Live Field syntax. The Template instantiator will traverse the dot notation and take the final dot segment as the Record Link or Live Field to be resolved.

Critically, the final object and field in the dot path must be configured as a Linkable Object and a Live Field; otherwise the Mention will not resolve when the Template is instantiated.

For example, an admin could type {!$Object.SecondObject.ThirdObject.Field__c}, where Object is the Source Object. The instantiator will traverse the dot notation and resolve to the final segment. That means:

  • Object does have to be configured as a Linkable Object: it is the Source Object of the Template, which itself must be a Linkable Object
  • SecondObject does not have to be configured as a Linkable Object: it is only an intermediate step in the dot-notation path
  • ThirdObject does have to be configured as a Linkable Object: it is the final object in the path
  • Field__c does have to be configured as a Live Field on ThirdObject

When resolved, the Mention will be inserted into the new Document as simply {!ThirdObject.Field__c}. The intermediate dot-notation steps are dropped once the final Mention value is resolved — the dot notation exists only to traverse the relationship path to the final destination.

A subtle distinction: Id references

There is a subtle but important distinction between how Id dot values behave during instantiation.

If you are creating a Template with Case as the Source Object:

  • {!$Case.AccountId} refers to the AccountId field on the Case object, which is itself an Account lookup field. If this Account lookup field on Case is configured as a Live Field, then the lookup will be resolved as a Live Field of a lookup data type on the Document.
  • {!$Case.Account.Id} is interpreted differently. Here, Case is treated only as the dot-notation path to get to the final segment, which is Account.Id. In this case, Id is the field being mentioned, pulled from the resolved Account, and anything that is *.Id is resolved as a Record Link, not a Live Field.

This means the same underlying record can be inserted as either a Live Field of a lookup data type or a Record Link depending on whether you reference the lookup field directly (Case.AccountId) or traverse to the related record’s Id (Case.Account.Id).

One reason you may opt for a *.Id (Record Link) over a *Id (Live Field of a lookup data type) is that any Record Link added into a Document is also used to automatically create a relationship to that record.

For example, if you insert {!$Case.Account.Id} in a Template, then {!$Account.Id} is inserted as a Record Link into the Document body when it is created, and a new relationship will be automatically created linking the new Document to that Account as well.

The Document is already automatically linked to the Case (since the Case is the Source Record and gets default-linked on instantiation). But if the Document also needs to be linked to the Account, then inserting the Account record’s Record Link will build that relationship for you automatically. The result: the Document will appear in the Folio Document Editor on both the Case record page and the Account record page, making it easy for people to find the Documents they need in context.

Mentions must match Admin Panel configuration

Mentions must be configured as Linkable Objects and Live Fields in the Admin Panel in order to resolve when the Template is instantiated. An admin can manually type in an invalid Mention syntax that looks correct in the Template but does not resolve at instantiation time.

For that reason, it is recommended to always use the Mention Picker to insert Mention syntax, unless you have a need to use multiple levels of dot notation. In that case, you must double-check that the final dot segment refers to an object and field that are set up as Linkable Objects and Live Fields.

Ways to instantiate a Template

There are two ways to instantiate a Template into a new Document:

1. Manually from the UI

Users can click New from Template from either:

  • The Folio Home page, or
  • The Document editor on any record page

Users are first prompted to select which Template they want to create a Document from. Then, based on the Source Object of the selected Template, they are prompted to select a Source Record of that same object. The Template is instantiated immediately, and the new Document opens with all Mentions resolved.

2. Programmatically from invocable Apex

Admins can configure the Create Document from Template invocable Apex action to programmatically instantiate a Template from any kind of record trigger.

For example, when an Opportunity Stage changes to Legal Negotiation, you might want a Sales-to-CS Handoff Template to be instantiated automatically, so the sales rep can start filling in info to pass to the CSM when the deal closes.

See Automate with Invocable Apex for more on configuring this action in Flow.

Related: Configure the Admin Panel · Automate with Invocable Apex · Insert Mentions with @ · Create Documents from Templates

Continue reading
Automate with Invocable Apex