if-exists

The if-exists Instruction conditionally executes a nested lists of Instructions depending on whether a named input value exists in the current Record in the input data.

action "if-exists"
source The property in the input Record.
then An array of Instructions to be executed when the value exists in the Record (optional).
else An array of Instructions to be executed when the value does not exist in the Record (optional).

See also if-has-value and if-value-one-of.

Example

{
    "action": "if-exists",
    "source": "supervisors",
    "then": [
        {
            "action": "set-value",
            "destination": "user",
            "name": "groups",
            "value": "example:group:student"
        }
    ],
    "else": [
        // ...
    ]
}