Jinja - Append values to a variable in a loop

by
Jeremy Canfield |
Updated: December 19 2022
| Jinja articles
Let's say the items list contains the following.
- item[0] = John
- item[1] = Doe
Here is how you could create a variable named name that contains John Doe.
{% for item in items %}
{% set name = item[0] %}
{% set name = name + " " + item1[1] %}
{% endfor %}
Did you find this article helpful?
If so, consider buying me a coffee over at