Skip to main content

Criteria definition

Komodo Care Connect lets you define custom criteria, or rules, on different custom metadata types for various features in the product. For example, custom criteria can be used to determine when a DocuSign envelope should be sent for electronic signatures, when the data change request (DCR) framework should run, and which Account records should be filtered out by Account Search.

Criteria definitions must be valid JSON strings with the following structure. Information about each JSON key and value are further detailed in Table 84, “Criteria properties below.

{
    "path":"<field API name>",
    "operator":"<operator>",
    "value":"<value>"
}

Warning

References to fields in the criteria cannot traverse relationships. Values must be set on the record in question.

Table 84. Criteria properties

Property

Description

path

The API name of the attribute that you want to base the criteria on.

Warning

This is case sensitive and should include any namespace as appropriate.

operator

The way in which the path relates to the value. The operator must equal one of the following:

  • Includes

  • IsNull

  • IsNotNull

  • isTrue

  • isFalse

  • Equals

  • NotEquals

  • Contains

  • NotContains

  • GreaterThan

  • GreaterThanOrEqualTo

  • LessThan

  • LessThanOrEqualTo

Note

isNull, isNotNull, isTrue, and isFalse do not require a corresponding value property.

Warning

Contains and NotContains are both case sensitive.

value

A string containing the desired value of the path that you want to base the criteria on.

Warning

This is case sensitive.

Note

A wildcard (*) can be used to match any value.



Compound criteria

Compound criteria may be used to build more complex rules. There are two compound criteria operators:

  • AnyTrue

  • AllTrue

To build compound criteria, wrap individual criteria statements in compound criteria operators:

{
    <compound criteria operator>: [
        {
            "path":"<field API name>",
            "operator":"<operator>",
            "value":"<value>"
        },
        {
            "path":"<field API name>",
            "operator":"<operator>",
            "value":"<value>"
        },
    ]
}

Example criteria definitions

Below are two criteria definitions for an example DCR configuration on the Account object. The custom criteria are defined on the Criteria JSON (mvn__PJN_Criteria_JSON__c) field on the Data Change Request Criteria (mvn__PJN_Data_Change_Request_Criteria__mdt) custom metadata type.

Table 85. Sample mvn__PJN_Criteria_JSON__c values

Criteria type

Description

Sample JSON string

Simple criteria

Tracks changes on a physician account.

{
    "path":"mvn__PJN_Record_Type_Developer_Name__c",
    "operator":"Equals",
    "value":"PJN_Physician"
}

Compound criteria

Tracks changes on either a physician or a staff account.

{
    "AnyTrue": [     
        {
            "path":"mvn__PJN_Record_Type_Developer_Name__c",
            "operator":"Equals",
            "value":"PJN_Physician" 
        }, 
        {
            "path":"mvn__PJN_Record_Type_Developer_Name__c",
            "operator":"Equals",
            "value":"PJN_Staff" 
        } 
    ]
}