Home Help How can I conditionally show or hide part of a template?

How can I conditionally show or hide part of a template?

Logic blocks let you show or hide part of a template based on information entered into a variable.

Here is a practical example.

Imagine that you are confirming a customer's information before preparing an invoice. You want to display a reminder about the customer's phone number, but only when a phone number has been entered.

Step 1: Create the variable

Create your template and add a Text field variable for the phone number.

Step 2: Write the optional content

Add the paragraph that should appear only when the customer provides a phone number.

For example:

Please double-check your phone number, as our team will contact you within the next few days.

Step 3: Select the content

Highlight the paragraph you want to control. Then open the Logic section in the editor.

Step 4: Build the condition

Configure the condition as follows:

  • Select the phone-number variable.
  • Choose Does not equal.
  • Leave the comparison field empty.

This tells Typedesk to show the selected paragraph when the phone-number field is not empty.

Step 5: Test both outcomes

Test the template twice:

  1. Leave the phone number empty and confirm that the optional paragraph stays hidden.
  2. Enter a phone number and confirm that the paragraph appears.

That is the whole trick. One template can now adapt itself without requiring a collection of almost-the-same versions.


Need more help?

Send us an email or chat with us using the button below. Our team will get back to you as quickly as possible!

Ask our community

Join our private Facebook group where you can ask tips and tricks to other typedesk users!


© Typedesk 2026. All rights reserved.