Skip to main content
Conditional Blocks

Conditionals allow you to dynamically show or hide content based on user properties or user events directly within a piece of content.

Jonathan Anderson avatar
Written by Jonathan Anderson
Updated this week

Overview: What are Conditional Blocks?

Conditionals are a powerful new component that allows you to dynamically show or hide content based on user properties or events directly within a piece of content. Instead of creating multiple Segments or Embeds, you can use conditional logic to personalize content for different user groups.

Key Benefits of Conditionals

  • Simplify content management by handling segmentation logic within a single piece of Candu content.

  • Reduce the need for creating multiple segments for content variations

  • Create more personalized user experiences based on properties like industry, plan type, or usage patterns

  • Because Conditionals sit within documents, you can easily import them across workspaces.

How Conditionals Work

  • Content will only be shown to users who meet the specified condition

  • Conditions are evaluated in order from top to bottom

  • Use the Layers panel to view and manage conditional blocks

A screenshot showing users how to find conditionals in the palette.

Setting Up Conditionals

Step 1: Add a Conditional Block

  1. Open the palette and find the conditional block

  2. Select 'Conditional Block' or drag and drop it into your Document

  3. Once selected, you can either drag content into the view or begin to add conditional logic.

A screenshot of the empty state of the conditional block with instructions for how to use it.

Step 2: Using Conditions

You can either create a new condition or use an existing one:

Create New Condition

  1. Click the "Add conditional logic" link in the Document or the "Open conditional logic in the toolbox."

  2. Next, click "Create New Condition."

  3. Enter a name for your conditional logic View.

  4. Choose a property, event, or segment to base your condition (e.g., email, industry, plan type). You can use any logical operator to build a Segment (e.g., "is one of").

  5. Enter the value(s) to match against

  6. Click "Add Condition" to include additional conditions if needed

Conditional setup with email property example.

Use an Existing Condition

Once you've created a conditional view, you can duplicate or edit that view.

  1. Select the "Use existing" tab

  2. Choose from the list of previously created conditions

  3. You can view and select multiple conditions if needed

A screenshots of the 'use existing

Step 3: Working with Conditional Content

Navigating Conditional Blocks

The Conditional Block structure consists of:

  • Parent: The main Conditional Block container

  • Children: Individual Conditional Views within the block

To navigate between these:

  • Use the Up/Down arrow keys to move between the parent Conditional Block and its child Views

  • Use the Layers panel to see the full hierarchy and quickly switch between views

  • Reference the breadcrumbs at the bottom of the Editor for your current location

Managing Conditional Content

  • Add any type of content to conditional views (text, images, buttons, etc.)

  • Use the options menu to edit, duplicate, move, or delete conditions

  • Reorder conditions using "Move up" and "Move down" options

    • Higher conditions are evaluated first

    • Users see content from the first condition they qualify for

Condition management options

Step 4: Testing Your Conditionals

Using the Share Link Preview

  1. Open your document's share link

  2. Click on the "Conditions" button in the top navigation bar

  3. Select different user properties or segments to test

  4. The content will update in real-time to show what different users would see

Data connection onboarding interface showing three integration options: JavaScript integration with code snippet, REST API integration, and direct data integration with tools like Segment, Amplitude, Hubspot, and Salesforce. Bottom section includes help options to invite a developer or chat with support.

Conditional Block FAQs

Can I nest conditional blocks within other conditionals?

Yes, you can nest conditional blocks within other conditional blocks. This allows you to create more complex personalization.

How can I preview what different users will see?

The "View as user" feature in the share link lets you preview how your content will appear to different users based on their properties and conditions.

Can I use Segments with Conditional Blocks?

You can use Segments as conditions using the "Segments: users are in" option when setting up your conditions.

Can I track analytics for conditional content views?

Detailed analytics for conditional content views are not currently available. While you cannot track when specific users view different conditional content variations, this feature is planned for future updates.

Need Help?

Please get in touch with our support team if you have questions about implementing conditionals or need assistance with specific use cases.

Did this answer your question?