Color type

Color type documentation.

Overview

This field type is designed to store color information. Colors are stored in hexadecimal format, and in the user interface, they are typically displayed as actual colors.

Available features

NameSupported
Many multiplicityyes
Default valuesyes
Unique flagno
Required flagyes
Indexable flagyes
Sensitive flagyes
Calculated valueyes
Automatic initializationno
Calculated initial valueno
Aggregationno
Default type rulesno
Default display optionsno

REST API

Read format

The format is a simple string with the hexadecimal code of the color:

"tagColor": "#f5a9a9"

Write format

When writing a value to a color type field, you should pass a string containing the hexadecimal code of the color. For example:

"tagColor": "#f5a9a9"

JavaScript API

Read format

When using the val() method in the wrapper for a color type field, it will return a string with the hexadecimal code of the color.

// this will print something like "color: #f5a9a9"
log('color: '+record.field('tagColor').val());

Write format

When writing a value to a color type field, you should pass a string with the hexadecimal code of the color.

record.field('tagColor').val('#f5a9a9');

Export/Import

Export format

The export format is a simple string with the hex code:

"tagColor"
"#f5a9a9"

Import format

The import format is a simple string with the hex code:

"tagColor"
"#f5a9a9"

Queries

For more information, please refer to the Query Language Documentation.

Available operators

OperatorSupported
equalsyes
notEqualsyes
emptyyes
notEmptyyes
likeno
greaterno
greaterOrEqualsno
lessno
lessOrEqualsno
betweenno
currentUserFieldno

Query formats

When using the query builder to filter records based on a color type field, you should pass the hexadecimal code of the color as a string. For example:

// finds skills with tag color '#f5a9a9' 
var records_sample = sys.data.find('skills', {'tagColor': 'like(#f5a9a9)'});
log('total: '+records_sample.count());
while (records_sample.hasNext()) {
    log(records_sample.next().label());
}
// finds skills with tag color '#f5a9a9' 
var query_sample = sys.data.createQuery('skills')
    .field('tagColor').like('#f5a9a9')
var records_sample = sys.data.find(query_sample);
log('total: '+records_sample.count());
while (records_sample.hasNext()) {
    log(records_sample.next().label());
}
// finds skills with tag color '#f5a9a9' 
GET /data/contacts?tagColor=like(#f5a9a9)

Aggregate queries

Please refer to the Aggregate Queries Documentation for more detailed information.

Available operators

OperatorSupported
sumno
avgno
firstyes
lastyes
minyes
maxyes

UI queries

Please refer to the UI Queries Documentation for more detailed information.

Matching of values

PropertyDescription
Matching operatorequals

Available operators

OperatorSupported
Many valuesyes
Greaterno
Greater or equalsno
Lessno
Less or equalsno
Betweenno