Skip to main content
Contributor
June 4, 2020

Technical Note: [FortiSOAR / Cybersponse Tricks'n'Tips] Passing a JINJA expression within a JINJA expression

  • June 4, 2020
  • 0 replies
  • 850 views
Description

If there is a need to refer a JINJA variable within another JINJA variable, then the right syntax do to that involves escaping and correct formatting of the resultant expression. Below is an example -


Let's say, there are two dynamic variables, vars.firstVariable and vars.secondVariable, then the correct expression to refer vars.secondVariable would be:


my_expression = {{vars.firstVariable|json_query("[?targetAsset=='"+ vars.secondVariable+"']")}}