Explanation: {% for label in data[0]|keys %} {% endfor %} {% for row in data %} {% for key, item in row %} {% endfor %} {% endfor %}
{{ label }}
{{ 'possible_keys' == key ? item|replace({',': ', '}) : item }}