Skip to main content
Esteemed Contributor III
Jun 4, 2020 4:16 PM UTC

Technical Note: [FortiSOAR / Cybersponse Tricks'n'Tips] Convert a one-dimensional list of objects to CSV

  • Apr 16, 2026 11:11 AM UTC
  • 0 replies
  • 779 views
  • Translate All
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.


Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024