Text type

Text type documentation.

Overview

This type can store free text of up to 300 characters. If you require more space, consider using the Long Text type.

Available features

NameSupported
Many multiplicityyes
Default valuesyes
Unique flagyes
Required flagyes
Indexable flagyes
Sensitive flagyes
Calculated valueyes
Automatic initializationno
Calculated initial valueno
Aggregationno
Default type rulesyes
Default display optionsyes

Type rules

Minimum length

Specifies the minimum number of characters allowed for field values.

Maximum length

Specifies the maximum number of characters allowed for field values.

Exact length

Requires that the value consists of a specific number of characters.

Regular expression

If set, you can use a regular expression to validate the value of the field. The expression should adhere to Java’s regular expression syntax.

The following options are available:

  • Expression: This field allows you to enter the regular expression for value validation.
  • Hint: In the event of a validation error, you can provide a user-friendly message here to assist users.
  • Case Insensitive: If enabled, matching will be case insensitive. It’s important to note that this only applies to simple characters in the expression. For instance, [a-z] will still require the letter to be lowercase, even if this flag is set. However, if you use “ab” in the expression, variations like “Ab” or “AB” will work.

Display options

Representation

Determines how the field should be displayed, primarily impacting the edit view. The available options are:

  • Input Box: Displays a single-line input box.
  • Text Area: Displays a text area. An additional option lets you specify the number of rows for the text area.

Limit number of characters

This restricts the number of characters displayed, accompanied by a “More” button to expand the content. This option exclusively affects read-only fields.

Background color

Defines whether the text value should appear as a label in the read-only view. By default, this value is null, resulting in the value being displayed without a label. You have the ability to establish multiple conditional background color rules. For each rule, you must select a color and define an expression. All fields matching the expression will adopt the chosen color. Alternatively, you can use a script in place of an expression. The script can make use of the following parameters:

  • record: Represents the current record that the field is a part of.
  • parentField: Applicable when the field is an inner field of a nested field type. This parameter enables referencing sibling fields.
  • action: Applicable when the field is a parameter of an action.

It’s important to note that this option comes into play only when the field is in read-only mode.

Password type

This denotes an editing control intended for entering passwords.

REST API

Read format

The format is a simple string:

"notes": "test1"

Write format

You should provide a string:

"notes": "new name"

JavaScript API

Read format

The val() method within the wrapper will return a plain string:

// this will print something like "notes: test notes"
log('name: '+record.field('name').val());

Write format

To set the value, you should provide a plain string:

record.field('name').val('new name');

Export/Import

Export format

The export format is a simple string:

"longTextField1","longTextField2"
"line1\nline2","this is a long text"

Import format

The import format is a simple string:

"longTextField1","longTextField2"
"line1\nline2","this is a long text"

Queries

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

Available operators

OperatorSupported
equalsyes
notEqualsyes
emptyyes
notEmptyyes
likeyes
greateryes
greaterOrEqualsyes
lessyes
lessOrEqualsyes
betweenyes
currentUserFieldno

Query formats

You should provide the text as a plain string. For example:

// finds companies with notes like 'ae' 
var records_sample = sys.data.find('companies', {'notes': 'like(ae)'});
log('total: '+records_sample.count());
while (records_sample.hasNext()) {
    log(records_sample.next().label());
}
// finds companies with notes like 'ae' 
var query_sample = sys.data.createQuery('companies')
    .field('notes').like('ae')
var records_sample = sys.data.find(query_sample);
log('total: '+records_sample.count());
while (records_sample.hasNext()) {
    log(records_sample.next().label());
}
// finds companies with notes like 'ae' 
GET /data/contacts?notes=like(ae)

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 operatorlike

Available operators

OperatorSupported
Many valuesyes
Greaterno
Greater or equalsno
Lessyes
Less or equalsyes
Betweenno