---
title: "How to show or hide template blocks and sections based on dynamic variables"
description: "Learn how to show a block or section to certain recipients with show/hide logic, and show different content to multiple audiences with show/hide logic variants."
canonical_url: "https://help.klaviyo.com/hc/en-us/articles/7655965301531"
markdown_url: "https://help.klaviyo.com/hc/en-us/articles/7655965301531.md"
locale: "en-us"
category: "Content"
section: "Build and use templates"
updated: "2026-11-06"
---

# How to show or hide template blocks and sections based on dynamic variables

## You will learn

Learn how to show a particular block or section in an email to certain recipients using the template editor’s show/hide logic, and how to show different versions of the same block or section to different audiences using show/hide logic variants.

You can use this to display different content to, for example, those in certain loyalty tiers or who purchased a particular product. With logic variants, you build each audience’s version of a block or section in one place, choose which version takes priority, and add a fallback for everyone else. This feature allows you to target your email content based on information about your subscribers, so each recipient has a highly personalized marketing experience.

## Before you begin

Both the logic builder and the custom-coded show/hide conditions below are used in drag-and-drop templates. If you have a saved HTML template, create a drag-and-drop copy first. You need permission to edit templates.

1. Go to **Content > Templates** and select **Email: saved**.

2. Open the HTML template’s three-dot menu and select **Clone to drag and drop**.

3. Select **Converted templates**. When the status is **Ready to use**, click the converted template’s name to open it in the drag-and-drop editor.



Your original HTML template stays unchanged. Review the copy’s layout and dynamic content before adding show/hide conditions. Learn more about [converting an HTML template to drag and drop](https://help.klaviyo.com/hc/en-us/articles/57211011501595.md).

You can show/hide content based on: 

- Profile data (i.e., profile or custom properties)

- Trigger event data in an event-triggered (also called metric-triggered) flow. Use the logic builder for properties available in its dropdown, or custom code for other conditions.



Before you craft your email, you must have the data you need in your account. In other words, you must have 1 event or profile with the property you want to use. 

**▸ Using profile data**

If you want to show or hide content based on profile data (e.g., location or language), you need at least 1 profile with that data.

Profile and custom properties can be added in the following ways: 

- [Sign-up forms](https://help.klaviyo.com/hc/en-us/articles/360026474752.md)

- [CSV uploads](https://help.klaviyo.com/hc/en-us/articles/1260806293150.md)

- [Ecommerce integrations](https://help.klaviyo.com/hc/en-us/categories/115000032731.md)

- List growth and loyalty integrations, like [Typeform](https://help.klaviyo.com/hc/en-us/articles/115000107112.md) or [Yotpo](https://connect.klaviyo.com/integrations/yotpo)



Learn more about [profile properties](https://help.klaviyo.com/hc/en-us/articles/115000250912.md) in Klaviyo.

**▸ Using event properties**

To use event properties, edit an email within the flow triggered by that event. Under **Condition type**, select **Properties of** followed by your trigger event’s name, such as **Properties of Placed Order**. The property dropdown lists data from that trigger event, including custom properties your events send. It does not look up the recipient’s past events or make trigger event data available to campaigns, list-triggered flows, or date-triggered flows.

So, in an abandoned cart flow with the trigger *Started Checkout*, you can build show/hide conditions based on a cart’s value or the specific items the customer added.

## Show a block or section to one audience

**📝 Note:** The show/hide logic builder supports profile and trigger event properties formatted as text, numbers, and lists. It does not support dates or booleans. If the property or comparison you need is not available in the builder, [use custom code to write the condition](#h_01JA8CWSGRE9CWVYBE9HS1VR3H). Conditions on nested or indexed event values (for example, `event.Items.0`) or that use filters also need custom code.

1. Add a block or section to an email template. 

2. Select the block or section, then select the **Display** tab.



![The display tab of a block](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/ecf4fbf524289fe98c04370c3b4bf98f34b74e40-814x290.png?auto=format)

3. Under **Show/hide logic**, select **Show only to a specific audience**.



![The Show only to a specific audience and Personalize for multiple audiences options under Show/hide logic.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/0a75b117382340acc146aaa9b3bdc8f55a37a04e-640x868.png?auto=format)

4. Under **Condition type**, select **Properties about someone** for profile data. In a flow email triggered by an event, you can instead select **Properties of** followed by the trigger event’s name, such as **Properties of Placed Order**. Choose a property, then choose a comparison. The comparison menu also sets the data type (text, number, or list). Enter a value if the condition requires one.



![The Condition type dropdown in the Show/hide logic panel, with Properties about someone and Properties of Placed Order.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/edfaf552c4e4b9f93caae885435428f783caa36e-1346x758.png?auto=format)

![A show/hide condition that displays the block when the Placed Order Value of the trigger event is greater than 100.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/5115d961b6877a26d33d1b8ef403195bd9ac56b5-1346x774.png?auto=format)

  - You can create a simple condition with a single criterion, or a more complex condition with several criteria connected by AND or OR. Learn more about [AND versus OR connectors](https://help.klaviyo.com/hc/en-us/articles/360036534631.md). 

5. Use the **Add condition** button to add additional conditions, if desired. 

6. Select **Save**. 



After you save, the **Show/hide logic** panel shows **Edit logic** and **Remove logic**. To show different content to other audiences in the same spot, select **Personalize for multiple audiences** and follow the steps to [show different content to multiple audiences](#h_slv_multiple_audiences).

Click Preview and check profiles that meet and do not meet your conditions, including profiles without the property. For event conditions, preview different occurrences of the flow’s trigger event, including ones that match and do not match. Confirm that each shows the intended content.

**⚠️ Warning:** If you apply show/hide logic to both a section and a block inside it, the block appears only when both conditions are true. Conflicting conditions can hide the block for every recipient. Learn more about [display options](https://help.klaviyo.com/hc/en-us/articles/4408802299547.md).

### AND vs. OR in show/hide conditions 

When evaluating show/hide logic, conditions connected by AND are evaluated before conditions connected by OR. Consider the order your logic will be evaluated when writing it to ensure it is interpreted as you intend. 

As an example, consider the following condition: 

![A sample segment condition](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/f3d885437ad22cbc59c57438513706acfd6942ca-1330x942.png?auto=format)

Following these criteria, see whether the block is visible for some sample recipients: 

| **Recipient** | **Does the block appear?** | **Why?** |
| --- | --- | --- |
| **Jane**  loyalty_points = 145  Favorite color = green   Favorite fruit = banana | No | Jane could qualify if her favorite color was *blue*, or if her favorite fruit was *kiwi*. |
| **Alex** loyalty_points = 73  Favorite color = blue  Favorite fruit = apple | No | Alex could qualify with more loyalty points, or if his favorite fruit was *kiwi*. |
| **Amanda** loyalty_points = 110  Favorite color = blue  Favorite fruit = pomegranate | Yes | Amanda qualifies because she has > 99 loyalty points and her favorite color is *blue*. Her favorite fruit is not considered because she meets both criteria on the opposite side of the OR operator. |
| **Stephanie** loyalty_points = 42  Favorite color = orange  Favorite fruit = kiwi | Yes | Stephanie qualifies because her favorite fruit is kiwi. The other conditions are not considered because she meets the criteria on one side of the OR operator. |

## Show different content to multiple audiences with logic variants

Use show/hide logic variants when each audience should see its own version of the same block or section, like a different banner for each loyalty tier. Instead of stacking separate blocks that each have their own show/hide logic, you build every version in one place. Each logic variant has a name, its own content, and its own show/hide condition.

### How logic variants work

- Logic variants are checked from top to bottom. Each recipient sees only the first variant they match, even if they also match a variant further down the list.

- Recipients who don’t match any variant see the fallback. If you don’t add a fallback, they don’t see anything in that spot.

- Each variant is its own copy of the block or section. Changing one variant’s content or styles doesn’t change any other variant.

- You can add up to 10 logic variants to a block or section, plus 1 fallback.

- Each variant’s condition works like any other show/hide condition. You can build it with the logic builder or write it as custom code.



### Create logic variants

1. Select the block or section you want to personalize, then select the **Display** tab.

2. Under **Show/hide logic**, select **Personalize for multiple audiences**. If the block already has show/hide logic, this option appears below **Edit logic** and **Remove logic**.

3. In the **Add variant** panel, enter a **Variant name** that describes the audience, like VIP. Names are optional and can be up to 50 characters. Unnamed variants are labeled by their position, such as Variant 1, and are renumbered when you reorder them.

4. Under **Logic**, build the condition for this audience. To write the condition yourself, select **Use code**.



![The Add variant panel with a variant named VIP and the condition Loyalty tier equals VIP.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/c0f38c90e3ecce538e90c9cb7dbbbc42aaf5517d-1204x993.png?auto=format)

5. Select **Save**. If the block didn’t have show/hide logic, it becomes your first variant. If it already had show/hide logic, it keeps that logic as the first variant, and a copy with your new condition is added as the second variant.

6. Select **Add variant** to create a version for another audience. Enter a name, build its condition, and select **Save**. The new variant starts as a copy of the variant you have selected and is added to the bottom of the list.

7. On the canvas, edit the new variant’s content. For example, swap its image or change its text.

8. Repeat steps 6 and 7 for each audience.

9. Optional: select **Add fallback** to show content to everyone who doesn’t match a variant. The fallback starts as a copy of your last variant without a condition, so edit its content for a general audience. It’s labeled *Default* and always stays at the bottom of the list.



![The Show/hide logic panel with VIP and Loyal logic variants and a Default fallback.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/4910060ea2d71a5176c1d71dc1f7255faef31d32-668x812.png?auto=format)

10. Click **Preview** and check a profile from each audience, plus a profile that doesn’t match any variant. Confirm that each one sees the intended version.



### View logic variants on the canvas

When you select a block or section with logic variants, a bar appears below the editor toolbar. Select **All** to see every variant on the canvas, or select **One** and choose a variant from the *Variant to show* dropdown. You can also select a variant’s card on the **Display** tab to select it on the canvas. Each variant is labeled with its block type and name, such as VIP.

![The canvas view switcher set to One with the Variant to show dropdown open, above a block labeled Text · VIP.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/c58795aa4ad888f478633f6fd3b06a3c0b4fa3eb-1196x690.png?auto=format)

The canvas shows the variant you choose and doesn’t evaluate conditions. To see which variant a specific recipient will get, use **Preview** with that recipient’s profile.

### Manage logic variants

Manage your variants from the **Show/hide logic** panel on the **Display** tab:

- **Change priority:** Drag variant cards up or down. Put your most specific audiences at the top. The fallback always stays at the bottom.

- **Rename a variant or change its condition:** Select the edit icon (*Edit logic*) on the variant’s card, update the name or condition, and select **Save**.

- **Copy a variant:** Select the clone icon (*Clone variant*). The copy is added directly below the original with the same content and condition.

- **Delete a variant:** Select the trash icon (*Delete variant*). If only 1 variant is left and there’s no fallback, it goes back to regular show/hide logic and keeps its condition.

- **Rename or delete the fallback:** Use the *Rename* or *Delete fallback* icons on the fallback card.

- **Duplicate or delete every variant at once:** Open the three-dot menu next to the count badge and select **Duplicate all** or **Delete all**. **Delete all** removes every variant and the fallback from your email.

- **Move the block:** Dragging a block or section with logic variants on the canvas moves all of its variants together.



### Logic variants and existing show/hide logic

Logic variants don’t change any show/hide logic you’ve already built. Blocks and sections with existing logic, whether created with the logic builder or custom code, render exactly as they did before. On the **Display** tab, they show **Edit logic** and **Remove logic** under **Show/hide logic**.

Separate blocks that each have their own show/hide logic aren’t combined into logic variants automatically. To combine them, create logic variants on one of the blocks, recreate the other versions as variants, then delete the extra blocks.

### Limitations

- Universal content blocks and sections, and custom object sections, support show/hide logic for one audience only. Logic variants aren’t available for them.

- A block or section with logic variants can’t be saved as universal content.

- Message analytics aren’t broken out by variant.

- If a variant includes a coupon, codes are still generated for recipients who see a different variant. Learn more about [coupons in messages](https://help.klaviyo.com/hc/en-us/articles/115005084727.md).



## Use cases for show/hide logic and logic variants

### Loyalty program banner

If you have a loyalty program, show active participants how many points they currently have. Offer contacts who haven’t yet signed up for the program an incentive for joining. To set this up, add a banner and create 2 logic variants. 

Show loyalty program participants with a positive points balance a variant named Members with this show/hide condition:

Loyalty points > is greater than 0 

![A condition to show a block to those with more than 0 loyalty points](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/ea10de7ffbf9073e869fe649d1ebaa5559065ef2-1326x210.png?auto=format)

If your integration leaves loyalty_points unset for people who have not joined, add a variant named Not enrolled with this condition:

loyalty_points > is not set

![A condition to show a block to those without a loyalty points property](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/72115cb0f3147b154288d525fdce65d3dd27d67b-1322x172.png?auto=format)

Adjust the criteria based on the data available in your account. The “is not set” condition also matches empty or false values, including numeric 0. If program members can have 0 points, use a membership property to distinguish members from people who have not joined.

### Personalized imagery

If you collect information about how your subscribers use your product, show them imagery that relates to them. 

For example, a brand that sells backpacks might ask whether subscribers use them for commuting, travel, or hiking. Depending on their answer, this brand could show imagery of their products in those environments. 

To set this up, add an image block and create 2 logic variants plus a fallback, each showing your product in a different setting. 

Show commuters a picture of a biker wearing the backpack during a commute with a variant named Commuting and this condition: 

Bag preference = Commuting

![A condition for those who use their bag to commute](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/50c1caf4eb522c04311384d13abdff96f199f69b-1322x162.png?auto=format)

Show travelers a picture of one of your backpacks in a busy airport with a variant named Travel and this condition: 

Bag preference = Travel

![A condition for those who use their bag to travel](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/7d5271af68a4fa3fe672b33f980946ce368e0bef-1314x164.png?auto=format)

Then, select **Add fallback** and use a picture of one of your backpacks in a scenic outdoor landscape. The fallback doesn’t need a condition. It shows to anyone who doesn’t match the Commuting or Travel variants, including recipients who don’t have a bag preference.

Notice that the fallback isn’t just targeted at hikers; anyone who isn’t a commuter or traveler will see it. A fallback makes sure recipients who don’t have this property set still see an image, so your email looks great for everyone. 

### Product-specific notes

**📝 Note:** Use the logic builder for event properties available in its dropdown. For a condition that uses a property or expression the builder cannot offer, use custom code, as in the example below.

Communicate product-specific information to cart abandoners, to give them key information that might influence their purchase decision. For example, if you are running out of a product, add a text block with a low-stock warning that only appears for people with that item in their cart with this condition:
'ITEM_NAME' in event.Items
Replace ITEM_NAME with the exact product name. This example assumes your trigger event has an Items list containing product names; use the variable and structure from your own event data.

![A condition for those with a specific item in their carts](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/6849cbb56a98161c1feac97bd19777f3534bfa04-486x90.png?auto=format)

### Location-specific messaging 

Location-specific conditions can only evaluate text; they cannot evaluate distance from a zip code. Show a custom banner to residents who live in a certain area, like those in the same town as your brick-and-mortar pop-up shop with this condition:

City = Boston

![A condition for residents of Boston](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/121fa3128b8197f309d511e5dffcda622faa5571-1328x164.png?auto=format)

If you have pop-up shops in several cities, create a logic variant of the banner for each city, such as City = Boston and City = Chicago, and add a fallback for everyone else.

## Troubleshooting show/hide blocks 

**⚠️ Warning:** Converting logic to code is not reversible.

If your show/hide block isn’t rendering as expected, select the block or section and click **Edit logic**. Select **Convert to code**, review the confirmation, and click **Convert**. Inspect and adjust the code, then click **Save**. For a logic variant, select the edit icon on the variant’s card instead of **Edit logic**.

Check how the property is stored and choose the appropriate condition type. Text comparisons distinguish the number 22 from the text value “22”. However, *Number* conditions in the logic builder convert numeric text, such as “22”, to a number before comparing it. Values that cannot be converted to numbers evaluate as 0, so check for missing or nonnumeric values when troubleshooting.

#### A recipient sees the wrong logic variant

Recipients see the first variant they match, starting from the top of the list. If a recipient matches more than 1 variant, drag the variant you want them to see higher in the list, or make its condition more specific.

#### Some recipients don’t see any content

If a recipient doesn’t match any variant and there’s no fallback, nothing shows in that spot. Add a fallback, or check that your conditions cover everyone, including recipients who don’t have the property set.

#### Converting text to numbers 

For custom-coded numeric comparisons, convert numeric text to a number using the |multiply filter. Add the filter directly after the variable name. For example, if your Age property stores age as numeric text:

person|lookup:'Age'|multiply:"1" > 21

#### Booleans stored as text 

If your true/false data is stored as text, not as a boolean, or if you are referencing a property that contains both booleans and text, you can use these structures to cover all scenarios. Include all spellings and capitalizations that are present in your data. 

| **Sample condition** | **Show the block if...** |
| --- | --- |
| person\|lookup:'VIP' == 1 or person\|lookup:'VIP' == 'true' or person\|lookup:'VIP' == 'True' | The VIP property is set to the boolean value true or the strings true or True |
| person\|lookup:'VIP' == 0 or person\|lookup:'VIP' == 'false' or person\|lookup:'VIP' == 'False' | The VIP property is set to the boolean value false or the strings false or False |

#### Comparison symbols in condition values

In the logic builder, condition values cannot contain comparison symbols such as =, <, or >. These values produce a validation error when you save. This restriction applies to the value you enter, not the property name. Other punctuation, such as spaces or an @ symbol, is not blocked by this validation. Property names and text values are case-sensitive, so match your data exactly.

**▸ Custom coding show/hide blocks**

If you prefer more control, or if you need a property or comparison that is not available in the logic builder, custom code your show/hide blocks. To start from scratch using code, select **Use code** next to *Logic* in the logic builder. You can write custom code for show/hide logic and for each logic variant.

![The Use code option in the logic builder.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/735638a53f2acfeb4ee651b503efb21b84967efd-1260x952.png?auto=format)

**⚠️ Warning:** Converting logic to code is not reversible.

To convert an existing condition, click **Edit logic** (or the edit icon on a variant’s card), then **Convert to code**. Review the confirmation and click **Convert**. After editing your code, click **Save**.

If you choose to use code, make sure you have a strong understanding of Django, programming logic, and Klaviyo’s data types. Klaviyo’s support team is not able to provide direct support or troubleshooting for custom code. 

🎬 [Watch video on Wistia](https://klaviyo.wistia.com/medias/62idy7e4ug)

Learn more about supported [condition structures](https://help.klaviyo.com/hc/en-us/articles/7655926841499.md). 

### Show/hide conditions based on event data

If your email is sent as part of an event-triggered flow (e.g., an abandoned cart or order confirmation flow), you can show/hide blocks based on the details of that flow’s trigger event. So, in an abandoned cart flow with the trigger *Started Checkout*, you can custom code show/hide conditions based on a cart’s value or the specific items the customer added. Learn more about [event variables](https://help.klaviyo.com/hc/en-us/articles/115002779071.md).

### Understand how data is stored

Before configuring your show/hide condition, check to see how your data is stored. There are 5 [data types](https://help.klaviyo.com/hc/en-us/articles/115005237648.md) in Klaviyo: 

- Text

- Number

- Date

- Boolean

- List



How your data is stored will influence which show/hide conditions will work for you. Learn how to [identify data types](https://help.klaviyo.com/hc/en-us/articles/115005237648.md) in your own account.

### Craft your message

The first step to adding custom-coded show/hide conditions in a message is to build the email template. This section will walk through a specific example using logic variants, but you can follow the same steps to set any block to display based on your own criteria.

For example, if your company sells leather bags, you may collect customer preferences for how they use their bags with a [sign-up form](https://help.klaviyo.com/hc/en-us/articles/360026474752.md), as shown below. 

![A sign-up form](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/98ba12eb8842ddfed32385ec467fe2296af7be75-1600x774.png?auto=format)

You can then display a different image based on your customer’s bag preference. For example, if the customer’s preference is “Work,” the bag will appear in an image next to a laptop. If the customer’s preference is “Outdoors,” the bag will appear near a scenic overlook on a hiking trail. 

1. Create a campaign or flow message.

2. Add an image block.

3. Upload the work-related image to the block.

4. Click **Display** from the image block’s customization menu.

5. Under *Show/hide logic*, select **Personalize for multiple audiences**. 

6. Enter Work as the **Variant name**, then select **Use code**.

7. Add this condition: *person|lookup:'Bag Preference' == 'Work'*. 

8. Click **Save**. 



This variant will show only to people who have selected “Work” as their preference. 

🎬 [Watch video on Wistia](https://klaviyo.wistia.com/medias/vlye260rwe)

Next, select **Add variant**. Name the variant Outdoors, select **Use code**, and use the condition *person|lookup:'Bag Preference' == 'Outdoors'*. Click **Save**, then replace the image in the new variant with the outdoor image.

This variant will only show to people who have selected “Outdoors” as their preference. 

![An Outdoors logic variant with a custom-coded condition.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/e2152446e0d0d269e38b8b1790d123c26cf984d9-1092x810.png?auto=format)

Finally, select **Add fallback** and replace the fallback’s image with a more generic image. The fallback appears for anyone who hasn’t selected either “Work” or “Outdoors,” including people who have never selected a preference, so it doesn’t need a condition.

![Work and Outdoors logic variants with a fallback.](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/410620a8b311ab04863bb0a235ad50d9af6b1439-668x824.png?auto=format)

Once you’ve configured each of the variants, preview your message using 3 profiles. These profiles should be subscribers who meet one of each of the image criteria:

- Customer who chose “Outdoors” 

- Customer who chose “Work”

- Customer with no preference or a preference other than “Work” or “Outdoors”



You can use these steps to show or hide blocks based on profile data. For event data, use a metric-triggered flow and reference properties from its trigger event.

### Create a show/hide condition with profile data

If you are building a custom-coded show/hide condition based on a profile property, replace the sample variable from the tables in the [conditional logic reference](https://help.klaviyo.com/hc/en-us/articles/7655926841499.md) (e.g., *person|lookup:'Favorite Color'*) with your profile property. 

To find the correct variable to use:

1. Select a text block, then click **Personalization** to open the personalization menu.

2. Choose an option from the menu to add it to the text block.

3. Copy the variable from inside the tag. Remove the curly brackets and fallback or formatting [filters](https://developers.klaviyo.com/en/docs/glossary_of_variable_filters) that you do not need for the comparison, such as *|default:''*. Keep any *lookup* filters that select the property.
For example, in the screenshot below, the full tag is *{{ person|lookup:"Accepts Marketing"|default:"" }}*. The variable name is *person|lookup:"Accepts Marketing"*, so select that portion to use in your show/hide condition. 



![A variable for show/hide logic](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/78c2ddaf3dc545d5a1cfc5f87620f930cd3c0aa0-1600x182.png?auto=format)

### Create a show/hide condition with event data

You can use event data to show or hide a block if your message is part of an event-triggered flow. Only data within the trigger event can be used in a show/hide condition. 

To identify event variables:

1. From the template editor, click **Preview**.

2. For a saved template, under *Preview data source*, click **Event**. In a metric-triggered flow message, the trigger event’s data is selected automatically.

3. If an event dropdown is available, select the metric that will trigger your flow. Use the arrows to choose a sample occurrence of the event.

4. Scroll through the *Event properties* to find the data you’d like to include. 

5. Click the property name to copy the tag. 

6. Paste the tag into a text block or text editor. 

7. Remove the curly brackets (i.e., {{ and }}) and fallback or formatting [filters](https://developers.klaviyo.com/en/docs/glossary_of_variable_filters) that you do not need for the comparison. Keep any *lookup* filters that select the event property.

8. Use the variable that remains in your show/hide condition.



In the screenshot below, you’ll see the tag *{{ event|lookup:'Item Count' }}.* You’ll only need the text *event|lookup:'Item Count'* for your show/hide condition. Note that your data may use a different structure, like *{{ event.extra.line_items.0.title }}* or *{{ event.ShippingAddress.address1 }}*. Use the variable as it appears in your event data. 

![Preview data to find event variables](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/3ad5d9243e5f7dd03cb1228d808cf93ec777ad36-1600x805.png?auto=format)

### Customize your show/hide conditions

Learn how to build custom show/hide conditions using the [conditional logic reference](https://help.klaviyo.com/hc/en-us/articles/7655926841499.md). This resource contains sample conditions, which you can customize using your own profile and event data.

## Additional resources

- [Conditional logic reference for templates](https://help.klaviyo.com/hc/en-us/articles/7655926841499.md)
  Learn about all the available conditions you can use to dynamically display a block, section, or custom-coded piece of content only to certain recipients. To learn how to use these conditions in your templates, head to our article on how to show or hide template blocks based on dynamic variables. 
- [Message personalization reference](https://help.klaviyo.com/hc/en-us/articles/4408802648731.md)
  Learn how to use Klaviyo’s personalization variables, or tags, to customize the experience for your customers.
- [Understanding profiles in Klaviyo](https://help.klaviyo.com/hc/en-us/articles/115005247088.md)
  Learn about profiles, including how to find them and the data available on the profile page. Profiles are used to keep track of all the information you have about your customers and prospects. 
- [Apply programming logic concepts to build more personalized messages](https://academy.klaviyo.com/apply-programming-logic-concepts-to-build-more-personalized-messages/1857035)
