if()

The if() function allows for a conditional evaluation that returns a boolean (i.e., true or false). Depending on the result, one of two expressions is run.

Syntax

if(condition, if true, if false)

Argument Description
condition

(required)

The condition to be evaluated and that returns a boolean.
value if true

(required)

The value (i.e., a hard-coded value, a reference to an attribute, or a function that returns a value) to return if the condition is true.
value if false

(required)

The value (i.e., a hard-coded value, a reference to an attribute, or a function that returns a value) to return if the condition is false.

Where Available

Available in all places the injected expression icon is visible, as well as within Filter fields on Cards, Tables and List/View sections.

Examples

Where Example(s)
Field Editability expression

Tab Visibility expression

Business rules: Condition

if(Business_Unit__c="East",Num1__c,Num2__c) > 15

if(Status_Color__c="Red",First_Milestone_Date__c, Program_Mid_Point__c) > today()

if(Status_Color__c="Red",addDays(Start_Date__c,5),addDays(Start_Date__c,10)) > today()

Dynamic Expression

Notification Body

Notification Subject

{!if(Status_Color__c="Red",Num1__c,Num2__c)}

{!if(Status_Color__c="Red", “Initiative is Red”, “Initiative is not Red”)}

Business rules: Set Value

Attribute expression

if(Status_Color__c="Red",Num1__c,Num2__c)
Embedded Section URL attribute

Business Rules: Call URL

External View URL on List/View

{!if(News_Source__c="ABC","https://abcnews.go.com/","https://www.nbcnews.com")}

{!if(Business_Unit__c="East",URL1__c, URL2__c)}

Metric Expression if(Stage_Gate__c="2",CAPEX__m,Total_Expense__m)

if(Status_Color__c=”Red”, sumIf(Initiative__t, OPEX__m, active=true and Urgency__c = "High"), sumif(Initiative__t, OPEX__m, active=true and Urgency__c != "High"))

if(OpEx__m.actual__d.quarter(0)>0, average(OpEx__m.actual__d.quarter(0), OpEx__m.actual__d.quarter(-1), OpEx__m.actual__d.quarter(-2), OpEx__m.actual__d.quarter(-3)), average(OpEx__m.actual__d.quarter(-1), OpEx__m.actual__d.quarter(-2), OpEx__m.actual__d.quarter(-3)))

If the current quarter OpEx metric holds an Actual value, average the current and past three quarters, else average the past 3 quarters.

 

Updated on January 29, 2024

Related Articles