ποΈQuery Conditions
Query conditions are used in many places that are Column Data Source Configurations, Forms, Actions, etc.
Last updated
Query conditions are used in many places that are Column Data Source Configurations, Forms, Actions, etc.
Last updated
Configure conditions:
Click "Add Condition" button
Select fields, operators and set values
Add more conditions
Operators can be the following.
For any field:
Equals - strict equality of value of selected field to one that is specified in "Value" field (for dates and times - matching selected range)
Not equal to - opposite to previous (strict unequality; for dates and times - out of selected range)
Is null - value of selected field is blank or absent (not set at all)
Is not null - opposite to previous (value of selected field exists and it is not blank)
For text and picklist fields:
Starts with - value of selected field starts with a substring (group of symbols) specified in "Value" field
Contains - value of selected field contains a substring specified in "Value" field
Does not contain - opposite to previous (value of selected field does not contain a specified substring)
For numeric (number, currency, percent, etc.) and date (date, time, datetime) fields (for date fields "less" means "earlier" and "greater" means "later"):
Less than - value of selected field is less than one specified in "Value" field
Greater than - value of selected field is greater than one specified in "Value" field
Less or equal - value of selected field is less than one specified in "Value" field or equal to it
Greater or equal - value of selected field is greater than one specified in "Value" field or equal to it
For multiselects:
Includes - value of selected field includes one specified in "Value" field (suitable to fields that does not support "contains" operator, like lists of IDs)
Excludes - opposite to previous (value of selected field does not include one specified in "Value" field)
For picklists, IDs, lookups:
In - value of selected field is in the list of values provided in "Value" field
Not in - opposite to previous (value of selected field is not in the list of values provided in "Value" field)
Operators "In / Not in" take lists of values in the following formats (in the order of their priority from highest to lowest):
JSON array - ["Value1","Value2","Value3"]
string with ;
delimeter - 'Value1;Value2;Value3'
string with ,
delimeter - 'Value1,Value2,Value3
'
If value have an umbiguous content, system will interprete in the order shown above.
E.g., the string 'Value1;Value2;Value3,4;Value5'
will be interpreted as ["Value1", "Value2", "Value3,4", "Value5"]
, not as ["Value1;Value2;Value3", "4,Value5"]
.
Values can be of different types:
Value - some static value
Field - values of the the fields of the Source object
Formula - compare with Merge fields of Context objects using formulas.
Provide condition logic expression if necessary:
Condition logic is build based on list of conditions user created.
If you don't fill Logic field then all conditions are validated all at once so record that gets validated should meet all conditions.
To use conditions in Logic expression one needs to operate conditions Index values. So {1} will represent Status = New condition, {2} will represent Closed = TRUE condition, etc.
Each condition Index must be enclosed in curved brackets
Following operators can be used when creating logic based on list of indexed conditions:
OR evaluates if at least one of multiple values or expressions is true.
AND evaluates if two values or expressions are both true.
NOT(expression that you want evaluated) - Returns FALSE for TRUE and TRUE for FALSE.
( ) specifies that the expressions within the open parenthesis and close parenthesis are evaluated first. All other expressions are evaluated using standard operator precedence.
Following condition will be met in case one of the listed clause return TRUE.
Following condition will be met when Case Status is not "New", Case Origin is "Phone" and Case is not Closed or Case Type is "Electrical".
Following condition will be met when Case Status is not "New" or when Case Origin is not "Phone" or when Case is not Closed and Case Type is not "Electrical".
{BR} operator is used to create WHERE part of Condition logic. Everything that goes after {BR} works the way clauses do after WHERE statement in Salesforce Object Query Language. Use SOQL SELECT Syntax after {BR} operator.
{BR} operator must go after base condition logic
Following condition will be met when Case Status is "New" and Case Origin is "Phone" or both Closed is TRUE and Case Type is "Electrical", and query will only include case where CreatedBy.Email='user@email.com' or LastModifiedDate greater than YESTERDAY.