{% macro recursive_folder_list_option(files, parentId, depth) %} {% for child in files %} {% if child.isDirectory and child.parent is not null and child.parent.id == parentId and child.deleted == false %} {{ _self.recursive_folder_list_option(files, child.id, depth + 1) }} {% endif %} {% endfor %} {% endmacro %}