Logic Functions

Usage

if(<Boolean Expression>, <Value if True>, <Value if False>)

The if function is used to evaluate whether a Boolean expression is true or false, and return different values based on the expression result.

Examples

if(1 = 1, "Values are the same", "Values are different")

In its simplest form, you can use the if() function to evaluate simple and complex expressions and print values based on the expression result.

For example, because "1 = 1" equates to the Boolean value true, the "Values are the same" text will be printed as the Field value.

You can use various operators in conjunction with the if() formula.

 

In (Used for value matching in Select, Link to User and Link to Role Fields)

if("Open" in @Status and "Important" in @Stage, "High Priority", "Low Priority")

 

Equal To

if(@Location = "San Francisco", "Event will be in SF", "Event will be outside of SF")

 

Not Equal To

if(@Location <> "Paris", "Event will be outside of Paris", "Event will be in Paris")

 

Greater Than

if(@Price > 5000, "Expensive", "Cheap")

 

Less Than

if(@Price < 1000, "Cheap", "Normal")

 

Greater Than or Equal To

if(@Task Priority >= 8, "Very Important", "Important")

 

Less Than or Equal To

if(@Task Priority <= 5, "Not Important", "Normal")

 

And/Or

if((@Price > 5000 and @Task Priority >=8) or "Very Important" in @Stage, "Expensive and Important", "Normal")

 

Not

if(Not true, false, true) => true

 

Note: Operators can also be used outside of the if() function.

Learn more about how you can get started using the Formula Field.

What would you improve in this article?
Powered by:

Type above and the results will be displayed here.