Variables
This document describes all the variables available in the Tera template context when rendering form templates.
If you are running into issues trying to access some variables you can always print all the available variables in you current context with the magical variable : __tera_context (use {{ __tera_context | debug }} for more visibility).
This documentation was created from the mobile tera context. We do our best to maintain the same context on mobile and web but there may be discrepancies. If your template only works on one of the plateforms, please notify us so we can update the context if necessary.
Available Variables
form_instance
Represents the current form instance being rendered.
Type: MobileFormInstance
Properties:
uuid(UUID): Unique identifier of the form instanceform_id(integer): ID of the associated formmade_at(integer, optional): Timestamp when instance was created (in seconds)created_at(integer): Creation timestamp (in seconds)progression(integer): Completion percentage (0-100)started_at(integer, optional): When the form was first started (in seconds)linked_event(UUID, optional): Associated event identifiercreated_by(integer): User ID who created the instanceclient_company_uuid(UUID, optional): Associated company identifierupdated_at(integer): Last update timestamp (in seconds)
Example
{{ form_instance.uuid }}
{{ form_instance.progression }}%
{% if form_instance.started_at %}Started at: {{ form_instance.started_at }}{% endif %}
field_values
Array of all field values for the current form instance.
Type: Array<WasmFieldValue>
Properties per item:
uuid(UUID): Unique identifier of the field valueform_instance_id(UUID): Associated form instance IDid(integer): Field IDmetadata(object): Additional metadata for the fieldvalue(any, optional): The actual field valuetype_(string): Field type (e.g., "company", "user", "image", etc.)name(string): Field nameslug(string): Field slug identifier
Example
{% for uuid, value in field_values | group_by(attribute="metadata.product") %}
{% set my_slug = value | filter(attribute="slug", value="my-slug") | first %}
{% if my_slug %}
{{ my_slug.value }}
{% endif %}
{% endfor %}
{% set company_fields = field_values | filter(attribute="type_", value="company") %}
client_company
Information about the associated client company (if any).
Type: WasmCompany
Properties:
uuid(UUID): Company unique identifiercreated_by(integer): User ID who created the companyowner_id(integer): Company owner user IDcompany_name(string): Company namecompany_website(string, optional): Website URLcompany_email(string, optional): Contact emailcompany_logo(string, optional): Logo image pathcompany_phone(string, optional): Phone numbercompany_billing_address(string, optional): Billing addresscompany_billing_post_code(string, optional): Billing postal codecompany_billing_city(string, optional): Billing citycompany_billing_country(string, optional): Billing countrystatus_id(integer, optional): Status IDimages(string, optional): Associated imagescreated_at(integer): Creation timestampupdated_at(integer, optional): Last update timestamplatitude(float, optional): GPS latitudelongitude(float, optional): GPS longitudestatus_name(string): Status display nameparent_name(string, optional): Parent company nameowner_name(string): Owner's nameowner_photo(string, optional): Owner's photo path
Example
<h1>{{ client_company.company_name }}</h1>
<p>Owner: {{ client_company.owner_name }}</p>
{% if client_company.company_website %}
<a href="{{ client_company.company_website }}">Website</a>
{% endif %}
products
HashMap of all available products indexed by UUID.
Type: HashMap<UUID, WasmProduct>
Properties per product:
uuid(UUID): Product unique identifiername(string): Product namedescription(string, optional): Product descriptionsummary(string, optional): Product summaryprice(float, optional): Product priceuser_id(integer): User who created the productcategory(integer, optional): Category IDbrand(integer, optional): Brand IDreference(string): Product referencebarcode(string): Product barcodecode_upc(string): UPC codestock(integer, optional): Available stocktax(float, optional): Tax ratestatus_id(integer, optional): Status IDouter(integer, optional): Outer packaging quantityimages(string, optional): Associated imagescreated_at(integer): Creation timestampupdated_at(integer, optional): Last update timestampwidth(float, optional): Product widthheight(float, optional): Product heightdepth(float, optional): Product depth
Example
{% for uuid, product in products %}
<div>
<h3>{{ product.name }}</h3>
<p>Price: {{ product.price }}</p>
<p>Stock: {{ product.stock | default: "N/A" }}</p>
</div>
{% endfor %}
user
Information about the user who created the form instance.
Type: WasmUser (optional)
Properties:
id(integer): User IDname(string): User full namephoto(string, optional): Profile photo pathemail(string): Email addressphone(string, optional): Phone number
Example
{% if user %}
Created by: {{ user.name }} ({{ user.email }})
{% if user.photo %}
<img src="{{ user.photo }}" alt="{{ user.name }}">
{% endif %}
{% endif %}
company_promo
Promotions that apply to the current company.
Type: Array<WasmPromotion>
Properties per promotion:
id(integer): Promotion IDname(string): Promotion namedescription(string, optional): Promotion descriptionperiods(object): Active periods configurationis_active(boolean): Whether promotion is currently activeproducts(array): Associated productscompanies(array): Associated companiesfields(array): Associated form fields
Example
{% if company_promo %}
<h3>Available Promotions</h3>
{% for promo in company_promo %}
{% if promo.is_active %}
<div>{{ promo.name }}</div>
{% endif %}
{% endfor %}
{% endif %}
promotions
All available promotions in the system.
Type: Array<WasmPromotion>
Same structure as company_promo but includes all promotions regardless of company association.
Example
<select name="promotion">
{% for promo in promotions %}
<option value="{{ promo.id }}">{{ promo.name }}</option>
{% endfor %}
</select>
assortments
Available product catalogues/assortments.
Type: Array<WasmAssortment>
Properties per assortment:
id(integer): Assortment IDname(string): Assortment name
Example
{% for assortment in assortments %}
<div>{{ assortment.name }}</div>
{% endfor %}
form_fields
All available form fields in the system.
Type: Array<WasmFormFields>
Properties per field:
id(integer): Field IDname(string): Field display namedata(string, optional): Field configuration datatype_(string): Field typeslug(string): Field slug identifieris_company(boolean): Whether field is company-relatedis_form(boolean): Whether field is form-relatedis_additional(boolean): Whether field is additionalis_product(boolean): Whether field is product-relatedconstraint(string, optional): Field constraintsis_promotion(boolean): Whether field is promotion-related
Example
{% set company_fields = form_fields | filter(attribute="is_company", value=true) %}
{% for field in company_fields %}
<label for="{{ field.slug }}">{{ field.name }}</label>
{% endfor %}
form_template
Current form template information.
Type: WasmFormTemplate
Properties:
id(integer): Template IDname(string): Template namescreens(object): Screen configuration
Example
<h1>{{ form_template.name }}</h1>
<!-- Access screen configuration -->
{{ form_template.screens.welcome_screen.title }}
resolved_images
HashMap mapping image hashes to resolved image paths.
Type: HashMap<String, WasmResolvedImage>
Properties per image:
thumb(string): Thumbnail image pathoriginal(string): Original image path
Example
{% for hash, image in resolved_images %}
<img src="{{ image.thumb }}" onclick="showOriginal('{{ image.original }}')" alt="Image">
{% endfor %}
lua_values
Custom values passed from Lua scripts (optional).
Type: Value (optional)
This variable contains any custom data structure passed from Lua scripts and can vary depending on the implementation.
Example
{% if lua_values %}
{{ lua_values.custom_field }}
{% endif %}
additional_columns
Configuration for additional database columns.
Type: Array<Object>
Properties per column:
id(integer): Column IDname(string): Column nametype(string): Column data typedata(object): Column configurationfield_id(integer, optional): Associated field ID
Example
{% for column in additional_columns %}
{% if column.field_id %}
Additional data for field {{ column.field_id }}: {{ column.name }}
{% endif %}
{% endfor %}
client_company_additional_columns
Additional column values for the current company (optional).
Type: Array<Object> (optional)
Properties per value:
additional_column_id(integer): Column IDvalue(object): Column value
Example
{% if client_company_additional_columns %}
{% for col_value in client_company_additional_columns %}
Column {{ col_value.additional_column_id }}: {{ col_value.value }}
{% endfor %}
{% endif %}
brands
Available product brands.
Type: Array<Object>
Properties per brand:
id(integer): Brand IDname(string): Brand namedescription(string, optional): Brand description
Example
<select name="brand">
{% for brand in brands %}
<option value="{{ brand.id }}">{{ brand.name }}</option>
{% endfor %}
</select>
Usage Tips
Accessing Nested Data
Many variables contain nested objects or arrays. Use dot notation to access nested properties:
{{ client_company.owner_name }}
{{ form_instance.created_at }}
Filtering and Iteration
Use Tera's built-in filters and control structures to work with arrays:
{% set image_fields = field_values | filter(attribute="type_", value="image") %}
{% for field in image_fields %}
{% if field.value %}
<!-- Display images -->
{% endif %}
{% endfor %}
Conditional Rendering
Check for existence and values before using optional fields:
{% if client_company.company_logo %}
<img src="{{ client_company.company_logo }}" alt="Company Logo">
{% endif %}
{% if form_instance.progression == 100 %}
<p>Form completed!</p>
{% endif %}
Working with Timestamps
Timestamps are provided in seconds since Unix epoch:
{% if form_instance.started_at %}
Started: {{ form_instance.started_at | date(format="%Y-%m-%d %H:%M") }}
{% endif %}