Conditional Variables

Sometimes you need your templates to be a little smarter...

Kenzie avatar
Written by Kenzie
Updated over a week ago

It is sometimes helpful to display variables only if that particular field is filled out. 

  • For example, you may not always fill in the company name, but when you do, you want it to show on the template. To do so, you'd use the following syntax: 

{{?qn.customer.company}}{{=qn.customer.company}}{{?}}

  • This basically asks if there is a company name present, and if so, output the name, otherwise don't print out anything. 

You can take this a step further, as we have with quote expirations, and include multiple variables, and text inside the conditional statement. 

{{?qn.quote.expires}}Quote is valid for {{=qn.quote.expires}}, expires on {{=qn.quote.expiry_date}}.{{?}} 

Did this answer your question?