Solved

Show logic for sexe property

  • 15 March 2024
  • 2 replies
  • 29 views

Userlevel 1
Badge +4

Hi,

 

I am creating a Sexe property that being populating slowly. So i have people that have the property filled with man or woman, and I have some people that don’t have the property. 

 

As my business in 90% female, I want to consider all the people that did not answer as female.

 

In my emails, i would like to show a product block to :

  • Male : person.Sexe == 'male' (seems to work)
  • Female and unknown : I don’t know what logic to use.

Thanks a lot for your help,

Laurent

icon

Best answer by KeviSunshine 15 March 2024, 12:25

View original

2 replies

Userlevel 4
Badge +7

Hi @Laurent,

A few things to clarify:

  1. Properties (“Sexe”) and values (“Male”, “Female”, blank) are case sensitive so make sure you know the exact case.
  2. Are you trying to do this as “Display logic” in an email template, or as text? The syntax is slightly different.

I’ll give some examples for both.

If you’re doing it in text, then…

{% if person.sexe == 'male' %}Show male content here{% elif person.sexe == 'female' %}Show female content here{% else %}Show fallback no male/female content here{% endif %}

If you’re looking for display logic, it’s just

  • person.sexe == "male"
  • person.sexe == "female"
  • person.sexe == "" (I am not 100% sure about this one)

 

Best,

Kevin.

Userlevel 7
Badge +37

Hi @Laurent 

To confirm @KeviSunshine response, to show a block when the gender is female or has no value, the display logic is person.sexe == ‘female’ or person.sexe == ‘’   

If you have added a value ‘unknown’ then it would be person.sexe == ‘female’ or person.sexe == ‘unknown’

Hope that helps

Regards

Andy

Reply