FortiSOAR Knowledge Base
FortiSOAR: Security Orchestration and Response software provides innovative case management, automation, and orchestration. It pulls together all of an organization's tools, helps unify operations, and reduce alert fatigue, context switching, and the mean time to respond to incidents.
Andy_G
Staff
Staff
Article Id 193192
Description

The following jinja will convert a one-dimensional list of objects to CSV. 

{% for key in vars.list[0].keys() -%}
{{ key }}{% if not loop.last %},{% endif %}
{%- endfor %}\n{% for item in vars.list -%}
{% for value in item.values() -%}
{{ value }}{% if not loop.last %},{% endif %}
{%- endfor %}{% if not loop.last %}\n{% endif %}
{%- endfor %}

 It assumes the list is set as vars.list.


Contributors