Skip to main content

Field types and options

This page provides additional information on data fields and their properties.

Data field types

Fields have properties describing their data type and recommendation on how filter controls are implemented.

  • type property: Integer, String, Boolean, Hyperlink, Label etc. The "type" describes how a field value is stored in the JSON.
  • control property: Regular, Select, SelectMulti, SelectEditable etc.

API call to list all fields with their properties: ./list/fields

Data field options

Some field types include an "options" property with additional useful information on the field.

For example, a select field (dropdown) will include there the list of values a user can choose from.

The options node contains an otype property. This property specifies the exact structure of the options.

The different variants are:

Ajax calls (otype = dicajax)

If the field is a code, options may indicate the ajax to retrieve the list of all codes and titles. Example for task codes:

  • otype: "dicajax".
  • url: The URL to call to get key/values
  • key: The name of the property containing the key (numeric or string)
  • value: The name of the property containing the title (string)
  • autocomplete: true or false. If true then the method supports auto-completion features.

 

Example:

CODE
"options": {
            "otype": "dicajax",
            "url": "/settings/tasks/codes",
            "key": "v",
            "value": "t"
        }

 

 

Key/Value lists (otype = dic)

Whenever the numeric field value can be converted to a title, the following options are included to translate the value into a title.

  • otype: "dic".
  • items: An array of options with key and value (display title). Properties are "v" for the value and "t" for the title.
  • key: "v"
  • value: "t"

 

Example:

CODE
"options": {
            "otype": "dic",
            "key": "v",
            "value": "t"
            "items": [
                {
                    "v": 0,
                    "t": "Fixed assignment"
                },
                {
                    "v": 1,
                    "t": "Job opening"
                },
                {
                    "v": 2,
                    "t": "Crowd"
                }
            ]
        }

 

 

Value lists (otype = list / default)

Additional details on the field:

  • otype: "list"
  • dom: To which object the field belongs. For example: 6 = job custom field.
  • id: The id of the custom field, a value between 1 and 40.
  • items: An array of allowed values. Only if field type is Select, SelectMulti or SelectEditable
  • key: "v"
  • value: "t"
  • splitchar: An optional character used with controls of type "Select" only. If specified, then the UI should render not one picklist but two cascading picklists. The character is used to split the value into two portions to populate the two lists. This is used with custom fields in Wordbee. The picklist custom field permits to specify a split character.

 

Example for a custom field of "picklist" / combo type. User is given 5 different options to choose from.

CODE
"options": {
            "otype": "list",
            "dom": 6,
            "id": 2,
            "items": [
                "1",
                "2",
                "3",
                "4",
                "5"
            ]
        }

 

 

Labels count (otype = labelcnt)

Used with fields of type "LabelsCount" and which simply counts how many labels are assigned to a job, a project etc.

Additional details on the field:

  • otype: "labelcnt"
  • cat: The label category (numeric) which specifies the object to which the label belongs (job, project, resource etc.)
  • catt: User friendly title for the category

 

Example:

CODE
"options": {
      "otype": "labelcnt",
      "cat": 2,
      "catt": "Jobs"
}

 

Label (otype = label)

Used with fields of type "Label". Contains full details for label such as available label values, titles and colors.

See example below. The most important elements are:

  • otype: "label"
  • cat: The label category (numeric) which specifies the object to which the label belongs (job, project, resource etc.)
  • catt: User friendly title for the category
  • properties/id: The unique label identifier ("cat" and "id" are together globally unique).
  • properties/name: The title of the label.
  • properties/options: The list of options to choose from for the label. Includes the name, the option id and an optional color code.

 

Example:

CODE
"options": {
	"otype": "label",
	"cat": 2,
	"catt": "Jobs",
	"properties": {
		"id": 6,
		"name": "Quality",
		"isSticky": false,
		"isStickyInLists": false,
		"options": [
			{
				"name": "Top",
				"value": 0,
				"htmlColor": "#BBBBFF"
			},
			{
				"name": "Medium",
				"value": 1,
				"htmlColor": "#BBBBFF"
			}
		]
	}

 

 

 

 

 

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.