Skip to main content
Solved

Show logic for sexe property

  • March 15, 2024
  • 2 replies
  • 39 views

Forum|alt.badge.img+6
  • Active Contributor II
  • 19 replies

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

Best answer by KeviSunshine

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.

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

KeviSunshine
Expert Problem Solver III
Forum|alt.badge.img+8
  • Expert Problem Solver III
  • 159 replies
  • Answer
  • March 15, 2024

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.


bluesnapper
Partner
Forum|alt.badge.img+45
  • Champion & Partner
  • 737 replies
  • March 15, 2024

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