Integer type
Overview
This type is designed to store integer numbers.
Available features
| Name | Supported |
|---|---|
| Many multiplicity | yes |
| Default values | yes |
| Unique flag | yes |
| Required flag | yes |
| Indexable flag | yes |
| Sensitive flag | yes |
| Calculated value | yes |
| Automatic initialization | no |
| Calculated initial value | no |
| Aggregation | yes |
| Default type rules | yes |
| Default display options | yes |
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
| Name | Type | Required | Description |
|---|---|---|---|
| options | object | no | These 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
| Operator | Supported |
|---|---|
| equals | yes |
| notEquals | yes |
| empty | yes |
| notEmpty | yes |
| like | no |
| greater | yes |
| greaterOrEquals | yes |
| less | yes |
| lessOrEquals | yes |
| between | yes |
| currentUserField | no |
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
| Operator | Supported |
|---|---|
| sum | yes |
| avg | yes |
| first | yes |
| last | yes |
| min | yes |
| max | yes |
UI queries
Please refer to the UI Queries Documentation for more detailed information.
Matching of values
| Property | Description |
|---|---|
| Matching operator | equals |
Available operators
| Operator | Supported |
|---|---|
| Many values | yes |
| Greater | no |
| Greater or equals | no |
| Less | yes |
| Less or equals | yes |
| Between | yes |