Skip to main content

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:

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


Thank you, it is!


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!


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


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


This is really cool thank you for all of the resources on how to set this up - I am looking forward to diving in.

All of the guides seem to be focused on profile properties, is it possible to have show hide rules based on behaviors?

Specifically I have a flow going out to new purchasers 3 days after purchase and would like to offer them any add-ons they didn’t buy in their initial purchase - but do not want to display anything they did buy.

Similarly with new leads, I have one header banner that gets the most engagement, I would like it to be the first one any lead sees when they open our emails - even if they only open email 3 or 4 in the flow I would like them to see the banner from email 1 (but obviously hide it from anyone who has opened any of our emails until now)

So, in short, I’d like to Show/Hide based on “Ordered Product” and on “Opened Email” behavior triggers, is that/how is this possible.

 

Thank you again for your continued awesomeness.


Hi @dgibbs,

 

Thanks for your* continued awesome and question! 

 

For your first situation, as long as the information you are looking for, what a customer bought and didn’t buy, is passed through your flow trigger, you should be able to create show/hide logic in a flow message. This documentation walk you through how to accomplish this

 

For your second situation, since this information isn’t a property or found in the flow’s trigger, this would best be accomplished through utilizing conditional splits in your flow. For instance, you can create the split log to see: what someone has done > opened email > ______(subject line of email 1) > at least once > over all time. If they have, they will travel down the ‘YES’ path and find an email that doesn’t have the banner from email 1 and if they travel down the ‘NO’ path, you will show an email with the banner since they didn’t see it in the original email.

 

Hope this helps! 

-Taylor 


Hi,

 

I was wondering if you could have more than one variable from the array in the list logic. For example, I’d like people who have Dog and/or Cat in the Pet property to be able to see the block. How would I set up the show/hide logic for this?


Hello @ABee,

I have used the logic below to show blocks to subscribers, based on a custom property that is a list of values:

'Dog' in person|lookup:'Pet' or 'Cat’ in person|lookup:'Pet'

You can repeat this logic several times using OR, and just change the type of pet. Hope this helps!


How can I show/hide content outside of a flow based on whether they have abandoned a basket in the last day?


I made a welcome flow for new subscribers en customers (in the same welcome flow. For subscribers I want them to show a coupon code and for new customers I want a text block with a big thank you for their first order.
Please could you tell me which logic I can use?

I tried a custom property with Made Purchase but it seems not workings. And with the logic; not person|lookup:'Made Purchase'

 

I hope some could help me.


Reply