Accelerate the Value of Data

Understanding the Expression Attribute

Learn about the expression attribute used in data validation functions.

The expression attribute can contain more than one condition with one or more logical operators (AND/OR) applied. The syntax of the expression attribute is ({Condition Type}[AND/OR {Condition Type}]*).

The definition of the expression attribute in a data validation function object consists of the following details:
  • Condition Type - Indicates the condition to be applied on the attribute.
    • Syntax of Condition Type - ConditionName(attributeName, value1 [, value 2 ..]*)
    • Example of Condition Type - gte(attribute.Age.value, '60'). For more examples, refer to the table below.
  • Logical Operator - Includes the AND/OR logical operators.
Table 1. Supported Condition Types
Condition TypeDescription
gtGreater than check for number and date
gteGreater than or equals check for number and date
lteLess than check for number and date
equalsExact match condition check ignores the case
equalsCaseSensitiveExact match condition check considers the case
startsWithStarting with condition value check
inValue is a part of a list check
rangeValue within specified range check for number and date
regexpRegular expression check
existsValue exists check
missingValue is missing check
notNegating the condition check
containsChecks if the attribute value contains the given value
containsWordsStartingWithChecks that the attribute value contains words starting with the given value
ltChecks if the attribute value is lesser than the given static date
If you use the the Data Validation Function (DVF) rule on a nested attribute like an identifier, the expression must include the inSameAttributeValue function. For example:
{
      "name": "Identifiers Numbers Only Check",
      "label": "Identifiers Numbers Only Check",
      "expression": "inSameAttributeValue(not regexp(attributes.Identifiers.value.ID.value, '[0-9]+') 
      and equals(attributes.Identifiers.value.Type.value,'UAN'))",
      "message": "Identifiers Numbers Only Check description",
      "attribute": "configuration/entityTypes/Organization/attributes/Identifiers"
}
The following image shows a sample expression in the Advanced editor:
Note: You can only edit an expression that uses the inSameAttributeValue function in the Advanced editor.

The inSameAttributeValue function works with lookup codes or with lookup values.

The following example uses UAN as the lookup code for the identifier type in the expression:
inSameAttributeValue(equals(attributes.Identifiers.value.Type.lookupCode, 'UAN') and exists(attributes.Identifiers.value.Type.lookupCode) and not regexp(attributes.Identifiers.value.ID.value, '[0-9]+'))
The following example uses Universal Account Number as the lookup value for the identifier type in the expression:
inSameAttributeValue(equals(attributes.Identifiers.value.Type.value, 'Universal Account Number') and exists(attributes.Identifiers.value.Type.value) and not regexp(attributes.Identifiers.value.ID.value, '[0-9]+'))