-
Notifications
You must be signed in to change notification settings - Fork 0
Template Language
lvanderlyn edited this page Aug 10, 2023
·
4 revisions
Anything between {{
}}
will be interpreted as an expression and the result of that expression will be evaluated to the user
-
{{ VAR }}
-> will output the value of the variableVAR
-
{{ VAR + 5 }}
-> will output the value ofVAR
plus the number 5 -
{{ VAR == 5 }}
-> will outputTrue
ifVAR
is equal to 5 otherwiseFalse
The syntax language supports the creation and evaluation of arbitrarily complex expressions, but does not support assignment.
It is important to leave a space between the braces and the input
It is important to refer to variables with the same capitalisation they were defined with.
The template syntax also supports returning information from tables.
-
{{ TABLE_NAME.COLUMN_NAME(VAR) }}
-> returns the value of an entry from the columnCOLUMN_NAME
from the tableTABLE_NAME
at the row where the columnVAR
has has the value stored inVAR
.- For example, if you have a table called "hotel_costs", with a column "country" and a column "cost" the following expression:
{{ hotel_costs.cost(country) }}
would return the cost associated with a given country.
- For example, if you have a table called "hotel_costs", with a column "country" and a column "cost" the following expression:
-
{{ TABLE_NAME.COLUMN_NAME(VAR1, VAR2) }}
-> returns the value ofCOLUMN_NAME
from the tableTABLE_NAME
at the row where the columnVAR1
has has the value stored inVAR1
and the columnVAR2
has the value stored inVAR2
-
{{ DAILY_COSTS.PER_DIAM(COUNTRY, CITY) }}
-> Returns the Per diam from the table daily costs, for the country and city specified by the user
-