Question

Conditional logic for number ranges


Badge +1

Hi, I am trying to build an email campaign using conditional logic, applied to content in the email sections. I have 4 x different types of content I want to show, depending on the score a user got in a quiz:
LOW: 'sugarquiz_score' <= 6
MEDIUM: 'sugarquiz_score' >6 and <15
HIGH: 'sugarquiz_score' >15 and <30
VERY HIGH: 'sugarquiz_score' >30

I have watched loads of tutorials, but can't find a solution that works to building the logic based on these number ranges. I have tried the following logic:

1. person|lookup:'sugarquiz_score' <= 6 (as per the tutorials)
2. person|lookup:'sugarquiz_score' < 6 (removing = sign)
3. person|lookup:'sugarquiz_score' <6 (removing spaces)
4. person|lookup:'sugarquiz_score' > 6 and person|lookup:'sugarquiz_score' < 15

None of these returned the content as it should have. The score result is definitely stored as a number, and - interestingly - when I added personalisation into the copy of the email using this: {{ person|lookup:'sugarquiz_score' }}, it pulled through the property data correctly, BUT only if I removed the content blocks that I was trying to use show/hide on. 

So, I have 3 questions:
1. Is my show/hide logic correct?
2. Can I use show/hide logic for number ranges, as I tried?
3. Can I use show/hide logic for sections, AS WELL AS in personalisation within the body copy of an email? 


0 replies

Be the first to reply!

Reply