Skip to main content

Jinja

Output text using a jinja template.

Makes use of a Jinja template to create a description, title, or summary based on your data.

info

Jinja templates do not allow variables with spaces. This wrangle automatically replaces spaces in column headers with underscores, so use underscores instead of spaces when referencing columns in the template.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
outputName of the column to be output to.array—Yes
inputSpecify a name of column containing a dictionary of elements to be used in jinja template. Otherwise, the column headers will be used as keys.string, nullnullNo
Options
templateA dictionary which defines the template/location as well as the form which the template is input. If any keys use a space, they must be replaced with an underscore. Note: spaces within column names are replaced by underscores (_).object—Yes
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No

Examples​

wrangles:
- create.jinja:
output: Description
template:
string: |
This is a {{ Brand }} {{ Item_Type }} that is {{ Size }}
SizeBrandItem Type
10mmSKFball bearing
15mmTimkenbearing seal
Description
This is a SKF ball bearing that is 10mm
This is a Timken bearing seal that is 15mm

Using | in YAML denotes a multi-line string that preserves line breaks. Use > for a multi-line string when line breaks should not be preserved.

Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID18
Catalog keycreate.jinja
Recipe keycreate.jinja
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespacecreate
Documentation groupcreate
AliasesNone
Runtime symbolwrangles.recipe_wrangles.create.jinja
Legacy UUID10fc6709-16d4-4eab-8f56-6cb5d170ea66

Sources