Integer type

Integer type documentation.

Overview

This type is designed to store integer numbers.

Available features

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

Type rules

Minimum value

The minimum value (inclusive).

Maximum value

The maximum value (inclusive).

Display options

  • Show Thousands Separator: If this flag is enabled, the thousands separator will be displayed in read-only mode. Please note that this flag does not impact edit mode.

REST API

Read format

The format is an integer number:

"numberOfEmployees": 8

Write format

To set the value, provide the integer number:

"numberOfEmployees": 10

JavaScript API

Read format

The val() method within the wrapper will return an instance of an integer number:

// this will print something like "numberOfEmployees: 8"
log('numberOfEmployees: '+record.field('numberOfEmployees').val());

Write format

To set the value, provide an integer number:

record.field('numberOfEmployees').val(10);

If you provide something that isn’t a number, the field will be set to null.

Wrapper method:
toHex()

The toHex() method returns string of hexadecimal representation of the value or empty ('') if null.

Returns

string - Hex value of number.

Samples
// prints the hex value of a integer field
var record = sys.data.findOne('projects', {name: 'Point-to-point link'});
sys.logs.debug('project number of people hex: '+record.field('numberOfPeople').toHex());


Wrapper method:
format(options)

Returns a string representing the formatted number value or an unformatted string.

Parameters
NameTypeRequiredDescription
optionsobjectnoThese parameters are used to format the value. If left empty, the default display options will be used for formatting.
- thousandsSeparator: If set to “true,” a thousands separator will be displayed; if set to “false,” it won’t.
Returns

string - String of formatted value of number.

Samples
// prints the formated value of a integer field
var record = sys.data.findOne('projects', {name: 'Point-to-point link'});
sys.logs.debug('project number of people: '+record.field('numberOfPeople').format({thousandsSeparator: true}));


Export/Import

Export format

The export format is an integer number:

"integerField1","integerField2"
"1383","-37"

Import format

The import format is a string with an integer number:

"integerField1","integerField2"
"1383","-37"

Queries

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

Available operators

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

Query formats

You should provide the number. For instance:

// finds companies with more than 10 employees 
var records_sample = sys.data.find('companies', {'numberOfEmployees': 'greater(10)'});
log('total: '+records_sample.count());
while (records_sample.hasNext()) {
    log(records_sample.next().label());
}
// finds companies with more than 10 employees 
var query_sample = sys.data.createQuery('companies')
    .field('numberOfEmployees').greater(10)
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 more than 10 employees 
GET /data/contacts?numberOfEmployees=greater(10)

Aggregate queries

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

Available operators

OperatorSupported
sumyes
avgyes
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
Lessyes
Less or equalsyes
Betweenyes