HELLO Salesforce Thinkers, In our previous blog we learned about Date and Time Formula Functions in Salesforce, In this blog we are going to learn about “Logical Formula Functions in Salesforce”.

Logical Formula Functions:
We have the following Logical Functions in Salesforce.
1. AND :
Returns a TRUE response if all values are true, returns a FALSE response if one or more values are false.
Syntax: AND(logical1,logical2,…)
Replace logical1, logical2,… with the values that you want evaluated.
2. BLANKVALUE :
Checks whether expression is blank and returns substitute_expression if it is blank. If expression is not blank, returns the original expression value.
Syntax: BLANKVALUE(expression, substitute_expression)
Replace expression with the expression you want evaluated and replace substitute_expression with the value you want to replace any blank values.
3. CASE :
Checks an expression against a series of values. If the expression compares equal to any value, the corresponding result is returned. If it is not equal to any of the values, the else-result is returned.
Syntax: CASE(expression, value1, result1, value2, result2,…,else_result)
Replace expression with the field or value you want compared to each specified value.
Replace each value and result with the value that must be equivalent to return the result entry.
Replace else_result with the value you want returned when the expression does not equal any values.
4. IF :
Determines if expressions are true or false. Returns a given value if true and another value if false.
Syntax: IF(logical_test, value_if_true, value_if_false)
Replace logical_test with the expression you want evaluated.
Replace value_if_true with the value you want returned if the expression is true.
Replace value_if_false with the value you want returned if the expression is false.
5. ISBLANK :
Checks whether an expression has a value, If it does not contain a value, returns TRUE . If it contains a value, this function returns FALSE.
Syntax: ISBLANK(expression)
Replace expression with the expression you want evaluated.
6. ISCLONE :
Checks if the record is a clone of another record and returns TRUE if one item is a clone. Otherwise, returns FALSE.
Syntax: ISCLONE()
We can use ISCLONE() to create a validation rule on an object and identify a record that’s a clone of another record.
NOTE:
- This function cannot be used with fields.
- Use the NOT function to reverse the return values of TRUE and FALSE.
7. ISNEW :
Checks if the formula is running during the creation of a new record and returns TRUE if it is. If an existing record is being updated, this function returns FALSE.
Syntax: ISNEW()
NOTE:
This function is available only in validation rules, field updates, workflow rules, assignment rules, and processes.
8. ISNULL
Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function returns FALSE.
Syntax: ISNULL(expression)
Replace expression with the expression you want evaluated.
NOTE:
Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL, but also supports text fields.
9. ISNUMBER :
Determines if a text value is a number and returns TRUE if it is. Otherwise, it returns FALSE.
Syntax: ISNUMBER(Text)
Replace text with the merge field name for the text field.
NOTE:
This function returns FALSE for blank values.
10. NOT :
Returns FALSE for TRUE and TRUE for FALSE.
Syntax: NOT(logical)
Replace logical with the expression that you want evaluated.
11. NULLVALUE
Determines if an expression is null (blank) and returns a substitute expression if it is. If the expression is not blank, returns the value of the expression.
Syntax: NULLVALUE(expression, substitute_expression)
Replace expression with the expression you want to evaluate replace substitute_expression with the value you want to replace any blank values.
NOTE:
Use BLANKVALUE instead of NULLVALUE in formulas.
BLANKVALUE has the same functionality as NULLVALUE, but also supports text fields.
12. OR :
Determines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if all expressions are false.
We can use this function as an alternative to the operator || (OR).
Syntax: OR(logical1, logical2…)
Replace any number of logical references with the expressions you want evaluated.
13. PRIORVALUE :
Returns the previous value of a field.
Syntax: PRIORVALUE(field)
NOTE:
This function is available only in validation rules, field updates, Workflow rules if the evaluation criteria is set to “Evaluate the rule when a record is: created, and every time it’s edited“, assignment rules, and processes.
Thanks for reading…