Solved

conditional statements gets printed instead of the expected outcome.

  • 7 April 2023
  • 3 replies
  • 95 views

So I’ve tried everything, title block, text block & html blocks. Re-checked my liquid too! 
 

The code that i am using:
{% if customer.typeform_score < 40 %} 40% {% elsif customer.typeform_score < 80 %} 80% {% else %} 100% {% endif %}

 

I am using the builder. And the code is printed like this:
 

 

 

What am i doing wrong? Like you can see i tried in both normal text field and title. Neither works, 

icon

Best answer by Ramy 7 April 2023, 15:54

View original

3 replies

Userlevel 1
Badge

Hi there!

 

Thank you for starting this thread! We’re happy to help you with your question here! :)

 

Generally speaking, when previewing your message and finding your Liquid is not rendering, this means that your message has Errors that can be seen via the “Review Errors” button on the top right of your editor!

Now keep in mind, that the error does not necessarily have to be in the code that is not evaluating as expected. For example, if your message is missing the “Subject line” or the “From” address, this will cause an Error that needs correction, and will stop your Liquid from rendering until the error is corrected!

This same methodology is very helpful in also debugging specific Liquid Errors, and our article on Common Composer Errors should be a perfect partner to resolving those. :)

 

I hope this is helpful! Please let us know if you need help with anything else on this issue!

Best Regards,

Hi there!

 

Thank you for starting this thread! We’re happy to help you with your question here! :)

 

Generally speaking, when previewing your message and finding your Liquid is not rendering, this means that your message has Errors that can be seen via the “Review Errors” button on the top right of your editor!

Now keep in mind, that the error does not necessarily have to be in the code that is not evaluating as expected. For example, if your message is missing the “Subject line” or the “From” address, this will cause an Error that needs correction, and will stop your Liquid from rendering until the error is corrected!

This same methodology is very helpful in also debugging specific Liquid Errors, and our article on Common Composer Errors should be a perfect partner to resolving those. :)

 

I hope this is helpful! Please let us know if you need help with anything else on this issue!

Best Regards,

Thx Ramy. 

 

It seems to be the liquid in the dynamic image field. See screenshot on how i used it, i am 100% this attribute does exist. Is this a bug?

 

Userlevel 1
Badge

Hello again!

 

Commonly, errors similar to this are because the profile you’re previewing the message for -visible on the left side- is missing this attribute.

This is to say that even though multiple profiles might have the attribute, and the message would display with no errors if you’re previewing those, if a profile you’re previewing doesn’t have the attribute, the error that “this variable is missing” will show.

 

I hope this helps!

Best,

Reply