Difference between revisions of "Template Variables"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Β 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
Template Variables are used to personalize communications from the platform. Β 
Template Variables are used to personalize communications from the platform. Β 
:For example, instead of a generic "Dear Sir" salutation, messages can be personalized: Β 
For example, instead of a generic "Dear Sir" salutation, messages can be personalized: '''Greetings ''Carl''!''' Β 
<blockquote>Greetings ''Carl''! Β 
__TOC__
Β 
You're invited to Friday nite Yappy Hour at the Dog Owners Club!
Hope to see you and ''Bruiser'' there!
</blockquote>
Β 
==About Template Variables==
==About Template Variables==
Template variables embedded into HTML templates provide this kind of merge capability. Β 
Template variables provide the ability to merge record data into a block of text. You embed the variable in the text as a placeholder and, at run time, data from the corresponding record field is inserted into its place.


HTML templates can be used in many areas of the platform:
{{:Template Variable Contexts}}
:{| border="1" cellpadding="5" cellspacing="1"
:''See also:'' [[Processing Related Records in a Template]]
Β 
! align="left"|Context
! align="left"|Available Variables
Β 
|-
|
*[[Email Templates]] and Letterheads
*[[Web Form]] notifications and auto-response email messages
|
*[[Template Variables in Email Templates]]
{{#if: {{ShowIsvInfo}} | *[[Template Variables in Service Provider Email Messages]] }}
|-
| [[Document Templates]]
|
*[[Template Variable Tool]]
Β 
|-
| [[Custom Form Actions]]
|
*[[Template Variables for Actions Using Execute JavaScript]]
Β 
|-
| Emails
|
*[[Template Variables in Email Templates]]
{{#if: {{ShowIsvInfo}} | *[[Template Variables in Service Provider Email Messages]] }}
|}


==Template Variable Tool==
==Template Variable Tool==
{{:Template Variable Contexts}}
{{:Using the Template Variable Tool}}
{{:Template Variable Tool}}
== Template Variable Syntax ==
== Template Variable Syntax ==
{{:Field Scripting Variables}}
{{:Field Scripting Variables}}
==Template Variable Resources==
{{:Template Variable Resources}}
<noinclude>
<noinclude>


[[Category:Glossary]]
[[Category:Glossary]]
</noinclude>
</noinclude>

Latest revision as of 02:12, 11 September 2013

Template Variables are used to personalize communications from the platform. For example, instead of a generic "Dear Sir" salutation, messages can be personalized: Greetings Carl!

About Template Variables

Template variables provide the ability to merge record data into a block of text. You embed the variable in the text as a placeholder and, at run time, data from the corresponding record field is inserted into its place.

Template variables have slightly different syntax in different contexts. In addition, the available variables can differ between contexts. The template variable tool gives you the possible variables, in the correct syntax for each context:

Context Available Variables
  • Record fields
  • User Fields, Company Fields

For Service Provider emails:

See also: Processing Related Records in a Template

Template Variable Tool

This tool is used to look up the names of variables that can be used in templates.
The variables are based on fields in objects:

TemplateVariableTool.jpg

To lookup a template variable:

  1. Choose a Category
    Category - Contains multiple categories of fields you can choose.
  2. Choose a field from the Category
    Fields - Contains the fields available in the selected category.
  3. The variable name is displayed. For example:
    Variable field: $user.full_name
  4. Copy the variable name from the field and paste it into your template or email.
Note: The field Name is displayed. It is likely to be somewhat different from the field Label that is displayed in the GUI.
Date and Time Fields

The Date and Time category contains:

  • Current Date:
    Inserts $today, which displays the date in the standard format.
    On June 24, 2011 the date would be displayed as "24 June, 2011".
  • Current Date User Date Format:
    Inserts $today_dateformatted, which uses the format set by the user, or by default, the format set for the company.
    For a date format of mm/dd/yyyy, the value on June 24, 2011 would show as "06/24/2011".

Template Variable Syntax

Depending on where they are used, variables may need to be specified with braces (${variable}) or without them ($variable). (See Template Variable Contexts for a list of places in which variables are available.)

Except for that difference, variables are standardized using the following syntax:

$objectname.fieldname
Where objectname is the name of the tab or object (Cases, Accounts, Contacts, etc.) and the fieldname is the name of the field (owner, description, etc.)
Second-degree Related Objects

Second-degree related objects can also be used in templates, and provide the ability to to drill down to one level of the hierarchical lookup from the object.

Second-degree related object variables are standardized using the following syntax:

$objectname.fieldname.seconddegree
Where objectname is the name of the tab or object (Cases, Accounts, Contacts, etc.), fieldname is the name of the field (owner, description, etc.) and seconddegree is the name of the second-degree related object
Examples
  • To get the tax_type of an autopolicy insurer, use this syntax:
$autopolicy.insurer.tax_type
Where 'autopolicy' and 'insurer' are objects, and 'tax_type' is a field in the 'insurer' object