If Function
If (condition as Boolean, truePart as Object, falsePart as Object) as Object
Category: | Logical |
<Description: | Checks whether a condition is true, and returns one value if TRUE and another value if FALSE . The "IF" condition can be nested and include additional "IF" conditions |
Supported Context: | FormulaField And BusinessRules |
Parameters: | |
condition as Boolean | Represents a condition or evaluation criteria that needs to result in a boolean value |
truePart as Object | Represents the resulting action if the data set in the "condition" parameter results in true |
falsePart as Object | Represents the resulting action if the data set in the "condition" parameter results in false. You can also enter another if() function within this parameter |
Returned value as Object | Returns either the data provided in the "truePart" or "falsePart" depending on whether the "condition" parameter evaluates to true or false |
Example #1 |
Set a checkbox custom field, based on Issue Severity If($Severity = “Critical”, TRUE, FALSE) |
Example #2 |
Setting the due date of an issue to be based off of its severity. In this scenario, the response time for a critical issue is set to 1 working day, 3 working days for a high severity, and 5 working days for all other severity levels. If($Severity = “Critical”, DateAdd($CreatedOn,Days(1,TRUE)),If($Severity= “High”, DateAdd($CreatedOn,Days(3,TRUE)),DateAdd($CreatedOn,Days(5,TRUE)))) |
Tips | To set standard field values based on formulas, create workflow rules |
Additional Links |