Tutorial

Using show/hide blocks

  • 23 June 2022
  • 5 replies
  • 442 views
Using show/hide blocks
Userlevel 3
Badge +1

Have you ever wondered how to only show certain content to select email recipients?

Well, show/hide blocks allow you to do just that! This function allows you to show content to some profiles based on their saved properties or events, and different content to other profiles based on their saved properties/events, all within one email. So, you don’t have to send multiple different emails to different audiences, if you don’t want to. 

In the new email editor, select ‘Display Options’ for any section or specific block. Here, you will find the ‘show/hide logic’ entry. This is where we will add our logic of who will see this specific block.

To show a block based on a saved profile property, every show/hide logic statement will follow this structure: person|lookup:’Name of Property Here’ . Please ensure capitalization matches exactly to how the property looks on the profile. That statement, will simply show the blocks if the person viewing has that property saved on their profile, at all. 

If you want to show the block based on a specific answer (or, value) that someone has for their saved property, then the logic would be as follows: person|lookup:'Name of Property Here' == 'Value you’re looking for' . Please remember to include two equal signs (==), regardless of the value. 

So, if I wanted to show a block to only people that have green saved as the value, for the profile property Favorite Color, then it would look like this: person|lookup:'Favorite Color' == 'green'

Next, you can also use numeric values and show/hide blocks based on less/greater than for these values. The format of this would look like the following: person|lookup:'Property Name Here' > Numeric Value . 

For example, if you wanted to show the block for viewers that have their age logged as greater than 20, the condition would be: person|lookup:'Age' > 20

With these conditions, the inequalities can be replaced with:

  • person|lookup:'Age' > 20 = The Age property contains a number greater than 20
  • person|lookup:'Age' >= 20 = The Age property contains a number greater than or equal to 20
  • person|lookup:'Age' < 20 = The Age property contains a number less than 20
  • person|lookup:'Age' <= 20 =  The Age property contains a number less than or equal to 20

Numeric value show/hide conditions are great for tracking loyalty points as well. 

Lastly, you can show/hide blocks based on a value in a list of values, for a profile property. For this, the conditional structure is: 'Value you’re looking for, can be more than one' in person|lookup:'Profile Property Name Here'

IE: If someone has multiple different colors listed as their favorite color for the profile property, then we can pull in anyone who has at least green listed by using: 'green' in person|lookup:'Favorite Colors'

If you wanted the block to show to anyone that has green and red listed as their favorite color (more than one value) then the condition would be: 'green, red' in person|lookup:'Favorite Colors'

Finally, you can do the inverse of the list option as well. So, if you want to show the block to everyone that does not have a certain answer listed. The conditional statement of this would be: not ‘value’ in person|lookup:'Profile Property Name Here'

So, if you wanted to show this block to everyone that does not have green listed as an answer in their profile property ‘Favorite Color’, this would be: not 'green' in person|lookup:'Favorite Colors' .

Show/Hide logic is great for customizing emails without having to create separate emails for audiences. This tool is powerful for personalizing content and reaching your viewers directly. 

Instead of using show/hide blocks, you can also curate your content to your audience by using logic like if/else statements which I’ll go over next time!

 

Additional Resources:


5 replies

Userlevel 7
Badge +53

If this is helpful, I wrote a mini tutorial on Show/Hide Blocks based on Custom Properties:

Userlevel 3
Badge +1

Thank you, it is!

Badge

Hi there

I can’t make i work with the following show logic:

 

person|lookup:'Reservation1NumberOfPets' == '1'

 

What I want it for the section to be shown to any recipients who have exactly 1 Pet, not those with 1 or less or those with 1 or more pets. 

What am I doing wrong?

 

Thank you in advance for your help!

Userlevel 7
Badge +58

Hey @Mettem,

I think your logic isn’t working as expected based on how you’re wrapping the 1. Depending on what the data type that value is would determine in how it should be defined. Essentially, if the value is in a text, string, or list type, you’ll want to use quotes. The same is true if it were in a boolean type for true or false statements. Numbers on the other hand are automatically recognized and wouldn’t need the quotes.

I would suggest re-evaluate what data type that 1 value is in to determine if quotes were needed.

David

Badge

Hi David

I chatted with a colleague of yours yesterday and she arrived at the same conclusion with the small detail that I only had to use 1x = before the number, seeing as == 1 would be interpreted as ‘is true’. I just coulnd’ find this guidance in your articles about conditional logic https://help.klaviyo.com/hc/en-us/articles/7655926841499-Conditional-logic-reference :) 

 

But thanks again and have a nice weekend!

Mette

Reply