{% set groups = namespace(dynamic_header = False, static_header = False) %} {% for datasource in datasources if not datasources[datasource].is_static %} {% if not groups.dynamic_header %} {% set groups.dynamic_header = True %}{% endif %} {% endfor %} {% if groups.dynamic_header %}{% endif %} {% for datasource in datasources if datasources[datasource].is_static %} {% if not groups.static_header %} {% set groups.static_header = True %}{% endif %} {% endfor %} {% if groups.static_header %}{% endif %}