TableLookupΒΆ

Checks if the value of a field is or is not in a configured field in a configured table.

Example Code:

validators {
  DefaultValidator {
    model = DefaultValidator
    config {
      fields {
        email.errorChecks {
          tableLookup {
            model = TableLookup
            table = fe_users
            field = email
            exists = False
            excludeHidden = True
            additionalWhere = FIND_IN_SET(1, usergroup)
          }
        }
      }
    }
  }
}

Properties

table

The name of the database table.

Mandatory

True

Data Type

String

field

The name of the field in the database table.

Mandatory

True

Data Type

String

exists

Set true if the value must already exist.

Mandatory

False

Data Type

Boolean

Default

False

excludeHidden

Set true to exclude hidden records from lookup.

Mandatory

False

Data Type

Boolean

Default

False

additionalWhere

Add your own conditions here to fit your needs. Like only lookup a certain user group, etc.

Mandatory

False

Data Type

String

Default

Empty String