How to Show Conditional Text with IF and ELSE in Planfix

April 23, 2024 5 min read 9

Conditional text in Planfix lets one task description say two different things: one message when a condition is met, another when it is not. The construct is a pair of variables, IF and ELSE, written around the text they control, and the Help Center article on variables in text sets out the full syntax. This two-minute video applies it to a familiar sales goal — giving customers a reason to make a larger purchase.

What you’ll learn: how to set up conditional text with IF and ELSE

  1. Where Planfix accepts conditional text: task names and descriptions, email templates and script actions.
  2. How to open the list of variables and insert the field your condition reads.
  3. The IF syntax: the logical formula, the text it controls and the closing block.
  4. How ELSE adds a second message for everyone who does not meet the condition.
  5. How ELSEIF stretches the same block over several thresholds.

How to set up conditional text in Planfix, step by step

Step 1. Pick the field the condition reads

Every condition compares a value, so start with the field that holds it: an order amount, an invoice number, a status. In the text, that field appears as a variable — its path in double curly brackets, such as {{Task.Order Amount}}. Conditional text works in task names and descriptions, in task templates, in email templates and in script actions, including Change description, Add comment and Set field value for Text fields. Variables in tasks are available only in paid and premium accounts.

Step 2. Insert the variable into the text

Open the field you want to make conditional and click the “different variables” link next to it. The list is built from your own account: about 30 system variables for date and time in various formats, every task field including each custom field, the fields of any directory used in task fields, the project with its custom project fields, the counterparty with data from the customer card, and the parent task of the current one. Select the field and it is added to the text at the cursor.

Step 3. Wrap the message in an IF block

Conditional text opens with %%$IF(Logical formula)$%%, continues with the text that should appear, and closes with %%$ENDBLOCK$%%. The logical formula compares the variable with a value. In the Help Center example, %%$IF({{Task.Order Amount}} > 100000)$%% prints the words VIP CUSTOMER in tasks whose order amount is above the threshold — and prints nothing in the rest. On its own, an IF block either shows its text or stays silent.

Step 4. Add the ELSE branch

ELSE is used only together with IF. When the condition is not true, Planfix displays the text from the ELSE part of the block instead, so the description always says something. The order is fixed: the IF line, the first text, %%$ELSE$%%, the second text, then %%$ENDBLOCK$%%. The Help Center shows the pattern on an empty field — if the invoice number is blank the reader sees that it is not filled in, and if it is filled in they see the confirmation.

Step 5. Extend the block or calculate inside it

For more than two outcomes, add %%$ELSEIF(Logical formula)$%% branches between IF and ELSE. Only the first branch whose condition is true is displayed and the rest are skipped; the closing ELSE is optional. If the message has to contain a number rather than fixed words, wrap the arithmetic in three percent signs — Discounted price: %%%{{Task.Price}}*0.8%%% — keeping the formula on a single line, since it cannot be broken with the Enter key. When the result belongs in a field of its own instead of the text, use calculated fields in Planfix.

Example: a message that encourages a larger order

The video builds its conditions around a loyalty goal: raising the average purchase amount. One branch speaks to a customer who has passed the threshold and tells them what they have earned; the other speaks to a customer who has not and invites them to add a little more. The same description serves both, because the text decides for itself which half to show. When the campaign changes, you edit one line in the template rather than briefing everyone who writes to customers.

Who it’s for

  • Sales: a deal description that reacts to the order amount instead of a manager remembering the current offer.
  • Marketing: a loyalty threshold written once and applied to every order that crosses it.
  • Support teams: a request that says out loud which required field is still empty.
  • Finance and back office: a reminder in the task itself when an invoice or contract number is missing.
  • Administrators: one template with the rule inside it, instead of instructions people are asked to follow.

FAQ

How do I write an IF condition in a Planfix task description?

Open %%$IF(Logical formula)$%%, add the text that should appear when the condition is true, and close the block with %%$ENDBLOCK$%%. The logical formula compares a variable with a value, for example an order amount above a threshold.

What if the text needs more than two options?

Add ELSEIF branches between IF and ELSE. Planfix displays the first branch whose condition is true and skips the others, and the final ELSE is an optional part of the block.

Does conditional text work in document templates?

Not with this syntax. The IF, ELSE and ELSEIF blocks described here belong to variables in text, and that Help Center article does not apply to document templates. Document templates have their own variables and their own functions, described in separate Help Center articles.

Start with one line your team retypes

Pick one sentence somebody rewrites by hand for every second record — a discount offer, a missing-document reminder, a thank-you that depends on the amount — and put it into the template as an IF and ELSE block. From there it joins the rest of business process automation in Planfix and travels with the records your customers actually see, which is part of what makes Planfix work as a CRM. For variables that fill a finished document rather than a description, see automating commercial proposals and deal numbering. New to Planfix? Sign up to try it.

Share article

Be the first to comment

You might also like