The ternary condition is a compact and efficient method to evaluate a condition and return one of two possible results, depending on whether the condition is true or false.
It is a shortcut often used in development to avoid writing long conditional structures like if...else.
➡️ Syntax:
➡️ The structure :
➡️ The Example:
In this example, we will explain the following simple formula:
This formula checks if the number of people present is greater than 5 and returns a response based on the result.
Let's use colored points to distinguish each part of the formula:
- 1 field 🟡: Present represents the data or value that we want to check.
-
1 operator 🟣:
>
is used to compare the field with a value. -
1 ternary condition 🟣: The
? :
allows you to choose between two results, depending on whether the condition is true or false.
🟰 The expected result:
- If Present = 8:
The condition becomes 8 > 5, which is true. The formula will then return "Yes". - If Present = 3:
The condition becomes 3 > 5, which is false. The formula will then return "No".
Before You Start
Getting Started with Formulas
The new formulas in Timetonic allow you to transform, calculate, and manipulate the information stored in your columns by combining multiple functions...
Or Continue With
Glossary View of Formulas
Quickly find the function or operator you're looking for or simply explore and learn how to use them...