Skip to main content
Question

Jinja2 Pipelines question, so nothing if field is empty

  • December 22, 2021
  • 0 replies
  • 226 views

Hi All,

I'm trying to get a pipelines email step to only show the text "Call Rating:" if the call rating field is not blank. I've tried:

{% if c.call_rating != '' %}
Call Rating: {{c.call_rating}}
{% else %}
''
{% endif %}​

and

{% if c.call_rating is defined %}
Call Rating: {{c.call_rating}}
{% else %}
''
{% endif %}

But the resulting email from both of those when that field is blank still says:

Call Rating:

Any idea how to get it so that line doesn't show in the email if that field is blank?

Thanks,



------------------------------
Daniel Johnson
------------------------------

This topic has been closed for replies.

Forum|alt.badge.img+4

You can use the {{CLEAR}} code:

{% if c.call_rating != '' %}
Call Rating: {{c.call_rating}}
{% else %}
{{CLEAR}}
{% endif %}​​

{% if c.call_rating is defined %}
Call Rating: {{c.call_rating}}
{% else %}
{{CLEAR}}
{% endif %}

Check out the documentation if you have the time, it's very helpful: https://help.quickbase.com/pipelines/transforming_data.html
------------------------------
Sean Connaughton
------------------------------