Jinja If statement equals field value
I'm trying to write an If statement in Pipelines for an email that if the Separation reason is retirement, do a line break and include the field value for if they are staying with the company as an instructor. If the reason is anything else, do a line break and move on to the next line.
{% if a.reason = "Other - Retirement" %} <br>Staying as Instructor:<b> {{a.instructor}}</b><br>{% else %}<br>{% endif %}
This is the same-ish format I was using for another Pipeline and it works just fine so I'm so confused as to why this one isn't working. The error says Incorrect Template. expected token 'end of statement block'. got '='
I want it to look like this if true:
Reason: Other - Retirement
Staying as Instructor: Yes/No
Next line: Value
If False it should look like this:
Reason: Other - Resignation
Next line: Value
Please help!! Thank you!
I am slowly, ever so slowly, learning some Jinja. In the Advanced Expressions I have discovered that the double equal sign is necessary.
{{a.numeric_field ==1or a.numeric_field ==3}}
Perhaps that is what you need to ensure the text values are the same. My understanding is that "=" sets something where as "==" checks if it is equal.