Need help with nesting statements for pipeline
I have two template tables that are related (Task template - parent and Subtask template - child). Both of these tables have a multi-select field called Task Category which could list property purchase, business purchase, lease, ground lease, construction, property sale, business sale as some tasks apply to multiple types of transactions. I also have the option of All if the task applies to any type of transaction. A transaction can involve several options - for example we could purchase the property and construct a building, or we could purchase a property and lease to a tenant. Upon the trigger of the pipeline, the appropriate Tasks are copied from the Task Template table to the Task table based on matching criteria. It works but I don't know how to add a 2nd step to also pull any tasks that are marked "All". I've attempted to add it within this statement as well as using AND but it errors . This is my current formula:
{% set list = a.deal_task_category.split(';') %}
{% for item in list %}
{% if loop.last %}{9.HAS.'{{item}}'}
{% else %}
{9.HAS.'{{item}}'}OR{% endif %}
{% endfor %}
I have a similar issue in next step for the subtasks. For this step I have three functions that I need to accomplish (1. I need to pull the Subtasks that relate to the copied Tasks (which I attempted to do in the first line in the formula below), 2&3. do the exact same as above - pull over the subtasks that match the Task Category and then pull over any subtasks that have "All". This is what I attempted but it gives "Valueerror: invalid literal for int() with base 10: 'id'
{{h.template_id == i.related_test_task_template}}
AND
{% set list = a.deal_task_category.split(';') %}
{% for item in list %}
{% if loop.last %}{25.HAS.'{{item}}'}
{% else %}
{25.HAS.'{{item}}'}OR{% endif %}
{% endfor %}
Any insight on how to add nesting request would be much appreciated!