-
Notifications
You must be signed in to change notification settings - Fork 0
Template Language
sheogorath15 edited this page Aug 14, 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.RETURN_COLUMN(LOOKUP_COLUMN=VAR) }}
-> returns the value of an entry from the columnRETURN_COLUMN
from the tableTABLE_NAME
at the row where the columnLOOKUP_COLUMN
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="Spain") }}
would return the cost associated with the given country "Spain".
- 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=VAL1, VAR2=VAL2) }}
-> returns the value ofCOLUMN_NAME
from the tableTABLE_NAME
at the row where the columnVAR1
has has the value stored inVAL1
and the columnVAR2
has the value stored inVAL2
-
{{ DAILY_COSTS.PER_DIAM(COUNTRY=USER_COUNTRY, CITY=USER_CITY) }}
-> Returns the Per diam from the table daily costs, for the country and city specified by the user (via the variablesUSER_COUNTRY
andUSER_CITY
)
-