Defining Validation Function

Data validation function can be defined on single or nested attributes only.

Data validation function is not supported for reference attributes and relation attributes. Each validation function can have the name, expression, action, and message attributes. To use the Data Validation Function APIs to create, update, retrieve, and delete validation functions, see https://data-validation-functions.reltio.com/swagger-ui.html.

Note: After adding or editing a validation function, the system takes five minutes of refresh time to update the changes.
Data Validation Functions can be defined in the following ways:

Defining Validation Functions in Reltio UI

The Data Validation Functions Editor in Reltio console helps you manage validation functions for the tenant and also provides an intuitive function builder to transform business requirements into data validation functions. For more information about defining validation functions using the Reltio UI, see Managing Validation Functions and Creating a Revalidate Job.

Defining Validation Functions using APIs

The table given below explains about the validation function attributes in detail.

Table 1. List of Attributes in Validation Function
Attributes Required/Optional Description
uri Optional This is a unique identifier that is automatically generated by the system. If a particular URI is provided then that validation function is updated.
name Required This is the name of the validation function.
label Optional If the label is not provided, then the value provided for the name attribute is considered for the label attribute.
description Optional This indicates the brief description of the validation function. If the description is not provided, then the value provided for the label attribute is considered for the description attribute.
expression Required This indicates the actual expression of the validation function containing the operation or condition name, and the validation input parameters. It can contain one or more operations or conditions with one or more logical operators (AND/OR). For more information, see Understanding the Expression Attribute.
action Optional This indicates the next course of action when the data validation function is violated. The default value is WARNING.
message Required This indicates the message that is displayed when a validation warning is reported.
attribute Required In case of multiple attribute expression, this indicates the attribute to which the warning message must be added.
createdBy System generated response field This indicates the user who created the validation function and is automatically picked up while creating the function.
createdTime System generated response field This indicates the time at which the validation function was created.
updatedBy System generated response field This indicates that the user updated the function and is automatically picked up while updating the function.
updateTime System generated response field This indicates the time at which the validation function was updated.
status System generated response field This indicates the status of the validation function and if this field is not provided as input, then the system takes ACTIVE as the default status. You can even make a function INACTIVE by providing the field's input value as INACTIVE.

Sample Validation Function

[
  {
    "name": "HCP.FirstName.01",
    "expression": "regexp(attributes.FirstName.value, '[a-zA-Z0-9]+')",
    "message": "FirstName cannot have special characters.",
    "attribute": "configuration/entityTypes/HCP/attributes/FirstName"
  },
  {
    "name": "HCP.CreditScore.01",
    "expression": "(equals(attributes.Status.value, 'Active') AND gte(attributes.CreditScore.value, '150') ) OR  Not equals(attributes.Status.value, 'Active')",
    "message": "HCP credit score should be greater than 150 for active profiles.",
    "attribute": "configuration/entityTypes/HCP/attributes/CreditScore"
  }
]