Skip to content

Commit 39c784d

Browse files
author
João Pinho
committed
update variables api docs
1 parent 4f6c675 commit 39c784d

2 files changed

Lines changed: 367 additions & 107 deletions

File tree

docs/templates/template-variables.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,42 @@ Each time an email or document template is used, the Template Variable API is ca
2121

2222
The Template Variable API uses the Entity API and others to fetch the correct values for each variable when compiling the template.
2323

24+
## Computed metadata fields
25+
26+
Some entity fields store identifiers (e.g. slugs or UUIDs). The Template Variables API expands selected metadata into computed fields using the `:<field>` suffix.
27+
28+
### Tags
29+
30+
Entities store tag slugs in `_tags`. To access the resolved tag names:
31+
32+
```handlebars
33+
{{<entity_slug>._tags:name}}
34+
```
35+
36+
Other examples:
37+
38+
```handlebars
39+
{{opportunity._tags:name}}
40+
{{_tags:name}}
41+
```
42+
43+
### Purpose
44+
45+
Entities store purpose IDs (UUIDs) in `_purpose` (multi-select). To access the resolved purpose names:
46+
47+
```handlebars
48+
{{<entity_slug>._purpose:name}}
49+
```
50+
51+
Other examples:
52+
53+
```handlebars
54+
{{opportunity._purpose:name}}
55+
{{_purpose:name}}
56+
```
57+
58+
If a purpose ID cannot be resolved, the raw ID is returned as a fallback.
59+
2460
## Variable Picker
2561

2662
We provide a picker UI for users to search and explore available variables.

0 commit comments

Comments
 (0)