I am trying to pass a dynamic value to my dictionary in my jinja template which in turn is a value. Code is as below:
"wan_link_info": [
{% for i in range(3) %}
{
"dummy": "{{ xyz_Links.abc_{{ i }}.abc_link_type }}",
}
{% endfor %}
]
Here the dummy will have value like xyz_Links.abc_0.abc_link_type, xyz_Links.abc_1.abc_link_type, etc.
These text will return a value. Example say:
{{xyz_Links.abc_0.abc_link_type}} = "Stackoverflow"
{{xyz_Links.abc_1.abc_link_type}} = "Facebook"
When I run the above code I get this error:
**"jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got '{'"**