Note
This is currently in Beta. If you are interested in accessing this beta feature, please contact your Customer Success Manager (CSM).
Overview
Administrators can use our powerful templating engine to enhance the data presented within a list view. This is an overview of the templating features available. The column template defined in settings also supports HTML (Javascript not supported).
To leveraged advanced configuration, update the column template based on the examples below.
Cross object fields
Prefix the field name with the cross object name. For example, if on the Jobs list view you wanted to display the related Accounts Billing City, the column template would be updated to the following.
{{ Account.BillingCity }}
Styling
Bold text
<b> {{ FieldName }} </b>
Italics
<i> {{ FieldName }} </i>
Underscore
<u> {{ FieldName }} </u>
Text colour
<span style="color: #HEX-CODE;">{{ FieldName }}</span>
Hyperlinks
The HTML <a> tag defines a hyperlink. It has the following syntax
<a href="url">link text </a>
Hyperlinks can be made relative such they can dynamically function across multiple team names, for example. Note how "https://team-name.my.skedulo.com" is not required when defining the target URL.
<a href="/job/{{ UID }}">Job</a>
Any field on the given object can be dynamically merged into the hyperlink template (including custom fields), enabling administrators to construct custom target URLs and dynamically generating the value presented within the cell on the list view.
Note in the below example, instead of a static value of "Job" being populated in the cell, the "Name" field on the Job object is being merged in
<a href="/job/{{ UID }}">{{ Name }}</a>
The above example would result in the following list view outcome.
Concatenation
Multiple fields can be merged within a column template by using the following syntax
{{Field_One}} {{Field_Two}} {{Field_n}}
Additional styling is also able to be applied when concatenating fields. For example, the below example would produce "JOB-0526 - (Repair)" in a single column.
<b> {{ Name }} </b> - ({{ Type }})
If Statements
If statements test a condition and selectively display content. If a condition evaluates to true, the "true statement" is displayed; otherwise, the "false statement" will be displayed. Also, it is possible to specify alternate conditions with 'elseif'.
The below example demonstrates checking "if" a field is populated and, if true, will display the field value and, if not, will return "not set."
{% if Type %} {# Checks if the Type field is populated #}
{{ Type }} {# If populated, the value within the type field is displayed #}
{% else %}
"Not set" {# If not populated, display not set #}
{% endif %} {# Closes the if statement #}
The below example demonstrates how 'elseif' can be utilised to evaluate multiple conditions whilst applying alternate styling.
{% if Type == "Repair" %} {# Check if the Type is equal to "Repair" #}
<b> {{ Type }} </b> {# If true, display the field value in bold #}
{% elseif Type == "Installation" %}{# Check if the Type is equal to "Installation" #}
<i> {{ Type}} </i> {# If true display the field value in italics #}
{& else &} {# otherwise #}
{{ Type }} {# display the field value with no additional styling #}
{% endif %} {# Closes the if statement #}
Expressions
You can use many types of literal expressions.
- Strings:
"How are you?"
,'How are you?'
- Numbers:
40
,30.123
- Arrays:
[1, 2, "array"]
- Dicts:
{ one: 1, two: 2 }
- Boolean:
true
,false
Math
Mathematical operations can be performed within list view cells. This should be done sparingly, as it will not enable users to filter or sort on the result as it is not stored within the database. The following operators are available:
- Addition:
+
- Subtraction:
-
- Division:
/
- Division and integer truncation:
//
- Division remainder:
%
- Multiplication:
*
- Power:
**
For example, You wish to display the cost of a Job based on the scheduled duration. A custom field stores the "rate" value on the Job object.
{{ Duration }} * {{ Rate }}
Comparisons
- Equals
==
- Equals (strict)
===
- Not equal to
!=
- Not equal to (strict)
!==
- Greater than
>
- Great than or equal to
>=
- Les than
<
- Les than or equal to
<=
Example
{% if Duration > 60 %}
Extended appointment
{% else %}
Standard appointment
{% endif %}
Logic
- and
and
- or
or
- not
not
- Use parentheses to group expressions
Date formatting
Date and Date/Time are stored in UTC format; if output directly within the column template, users wouldn't see an overly human readable value, for example, 2021-02-19T16:00:00.000Z. To display the value for Web App users to easily recognise, it requires to be formatted. The following format options are available.
Modifier | Output | |
Day | d | 1...5, 6 |
do | 1st, 5th, 6th | |
dd | Su, Mo ... Fr, Sa | |
ddd | Sun, Mon ... Fri, Sat | |
dddd | Sunday, Monday ... Friday, Saturday | |
Month | M | 1,2 ... 11, 12 |
Mo | 1st 2nd .. 11th, 12th | |
MM | 01, 02 .. 11, 12 | |
MMM | Jan, Feb ... Nov, Dec | |
MMMM | Jauary, February ... November, December | |
Year | YY | 20, 21 ... 22, 23 |
YYYY | 2020, 2021 ... 2022,2023 | |
Quarter | Q | 1 2 3 4 |
Qo | 1st 2nd 3rd 4th | |
AM/PM | A | AM PM |
a | am pm | |
Hour | H | 0, 1 ... 22,23 |
HH | 00,01 ... 22,23 | |
h | 1 2 ... 11,12 | |
hh | 00,01 ... 11,12 | |
k | 1 2 ... 23,24 | |
kk | 01,02 ... 23,24 | |
Minute | m | 0,1 ... 58,59 |
mm | 00,01 ... 58,59 | |
Timezone | z | BST, CET, GMT |
Examples
{{ Start | date("ddd D MMM YYYY") }} {# Thu 11 Mar 2020 #}
{{ Start | date("ddd D MMM YYYY h:mma") }} {# Thu 11 Mar 2020 8:08am #}
{{ Start | date("ddd D MMM YYYY h:mma (z)") }} {# Thu 11 Mar 2020 8:08am (CET) #}
Time formatting
The "time" value of a date/time field can be isolated to display only the 'time' within the cell on a list view.
Example
{{ Start | date("h:mma (z)") }} {# 8:08am (CET) #}
Timezone manipulation
By default, all date/time values are adjusted from UTC to the timezone set on the device accessing Skedulo. Sometimes, it may be a requirement to adjust the date/time to an alternate timezone.
For example, when displaying a list of Jobs, the user would most often like to see when the Job is taking place for the customer instead of the time it would be for the user. (assuming the users' timezone is different to the timezone of the Job)
Administrators can configure any date/time field to be presented in any valid timezone.
Examples
Start | date("tz", Region.Timezone) %} {# offset the date value by the region timezone #}
{% if Start %} {# Check if there is a value for the start field #}
{% set tzStart = Start | date("tz", Region.Timezone) %} {# offset start date by timezone #}
{% set tzEnd = End | date("tz", Region.Timezone) %} {# offset end date by timezone #}
{{ tzStart| date("ddd D MMM YYYY") }}, </br> {# apply formatting to timezone adjusted date #}
{{ tzStart|date("h:mma") }} - {{ tzEnd|date("h:mma (z)") }} {# #}
{% else %} {# otherwise #}
<span style="color: #7d879c;">Not Set</span> {# if no value stored in the start field, display not set #}
{% endif %} {# close if statement #}
Comments
0 comments
Please sign in to leave a comment.