See Stacksync in action with a solution architect. Book a demo ↗

Variable replacement

Variable replacement rules in module fields.

Variables in module input fields are replaced following the standard Jinja templating rules, here are some examples:

Comment on source valueSource value (exact value of x)Body to be replacedFinal resultComment on final result
null valuenull{{ x }}nullnull value
stringhello{{ x }}hellostring
json{"y":"world"}{{ x }}{"y":"world"}json
string{"y":"world"}{{ x }}{"y":"world"}string
number123{{ x }}123number
string123{{ x }}123string
empty string{{ x }}empty string
string{{ text }}{{ x }}{{ text }}string
null valuenull{{ x.y }}nullnull value
stringhello{{ x.y }}nullnull value
json{"y":"world"}{{ x.y }}worldstring
empty string{{ x.y }}nullempty string
json{"y":"world"}{{ x.y }}worldstring
string{"y":"world"}{{ x.y }}nullnull value
number123{{ x.y }}nullnumber
string123{{ x.y }}nullstring
json{"y":123}{{ x.y }}123number
json{"y":"123"}{{ x.y }}123string
string{{ text }}{{ x.y }}{{ text }}string

Not replacing sections enclosed in double curly brackets

Use cases require to have a text between curly brackets NOT replaced by the templating engine.

An example body not to be replaced is {{ customer text that should remain in curly brackets }}
In this case, the text not to be replaced can be formatted as follows to maintain the curly brackets

 {{ {{ customer text that should remain in curly brackets }} }}

where the final result would be in the final body (after replacement) is

{{ customer text that should remain in curly brackets }}

On this page