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 192094
Description

I am trying to find a record using some conditions from the emails module


image



In the retrieve email body step I am trying to set the variable this way


image


Testing whether the value includes anything and hence setting its value otherwise doing nothing.


I am facing this error


image


I think is caused by not finding the Required emailm however isn't the defined condition in the if condition supposed to avoid this issue?





Instead of using 'is defined' simply use this way {% if vars.steps.Copy__of_Find_Emails%} {{vars.steps.Copy__ofFind_Emails[0]}} ...... 


for. eg - {%if vars.result.asset_iri %} {{vars.result.asset_iri}}{%else%}None{%endif%}  



Looking at this it tells that vars.steps.Copy__of_Find_Emails  is defined and it's is dict not list as we are expecting it to be list by using vars.steps.Copy__of_Find_Emails[0] . 


However, to understand what is going on, setting any dict in the if clause automatically sets it as a condition to if its Null or Not

 


Contributors