Skip to content

$commons.validate - Unique value fields

This costumization provides generic keywords that will extend your RecordM validation capabilities.

Install

cob-cli customize commons-validators

WARNING

Requires RecordM restart

Usage

$common.validate(<validation 1>,<validation 2>, ...)
ParameterDescription
emailWill ensure that the field has valid email address
uniqueValue(showLink=<true, false>)Use it when you want to ensure that a field has a value that is unique in the entire definition data. One of the most typical scenario for using the uniqueValue validation is when you want to ensure that in a user definition no two users have the same username
regex(<regex>)To validate that the value follows a specific format

Examples

1. Making the user username unique in a User Data block

Username: $commons.validate(uniqueValue(showLink=true))

2. Validating an email

Username: $commons.validate(email)

2. Validating based on a regex

IP: $commons.validate(regex(^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$))