Skip to main content

./list/fields

The API lets you fetch lists of data such as projects, jobs, orders, people, configurations and so on.

URL

(POST) ./list/fields

Examples: /jobs/list/fields


PARAMETERS

None.


RESULTS

The result includes a cols node with a list of all available fields. Each field has these properties:

id

The column ID.

string
type

The data type, any of:

  • Integer: A number
  • Decimal: A number with optional decimal position '.' (dot).
  • String: A string
  • Date: Date part only (year, month, day)
  • DateTime: Full date/time
  • Boolean: A boolean
  • Hyperlink: Contains a hyperlink or email link etc.
  • Image: Contains an image reference. To display the image you need to call the media related API method.
  • Label: The selected option for the label's value or null if label is not assigned. There is one field per label of an object.
  • LabelCount: Total assigned labels of an object. Contains a property "cnt" with total set labels and "xp" with explicitly set labels.
  • Object: Any other data type


string
control

Specifies how a user can select values (e.g. how a UI filter control would be implemented):

  • Standard: Corresponding to the type. For example, a string-type would be a free text field.
  • Select: Field can have null or a value from a list. See the "options" property for either AJAX information or list of permitted values/titles.
  • SelectMulti: Field can contain multiple values from a list. See "options" property like above.
  • SelectEditable: Field proposes a list but user can type any other string as well. See "options" property like above.

string
nameA user friendly title of the field.string
descA user friendly description of the field.string
fnameFilter title if different from "title". Whereas "title" is worded to serve as a column header in a list, "ftitle" is focused to be used as a filter control label.string?
fdescFilter description/tooltip if different from "desc"string?
nullableIf true then the field can have a null value.bool
maxOptional maximum length of the field value.int?
isdata

True if the field is always included with the results.

Generally, these are fields not shown to end users: Internal object identifiers etc.

bool
iscol

A column field. A field that can be shown to end users. In the Wordbee system the field is shown in a separate grid column.

bool
iscoldef

A default column field. By default this field is shown to the user.

bool
canqueryIf true then the field can be filtered by means of the layout.query parameter.bool
cansort

If true then data can be sorted by this field.

bool
canautocompleteIf true, then you can use the auto-completion service for this field. See ./list/autocomplete (post)bool
options

This is used for filtering or querying purposes. For example: Pickup list fields may require you to know which possible values the field can have.

Full details can be found here: Field types and options


Example for an ajax instruction to retrieve the list of all codes and titles. Example for task codes:

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


Example of a key / value list of options:

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


 More information


object?
widthOptional default user interface width. For example: "10%", "200px" etc. Null means that the width will be adjusted automatically in the web interface.string?
uifilterInternal use. 0 = no filter, 1 = top, 2 = primary, 3 = secondary


About fields in results

If you execute a query with ./list/full you get:

  • All fields

If you specify your fields when querying ./list, you get: 

  • All fields listed in the query's fields parameter
  • And all fields with isdata = true (these cannot be removed)

If you do not specify your fields when querying ./list, you get: 

  • And all fields with isdata = true or iscoldef = true


EXAMPLES

A JSON array of fields. An example with jobs when calling /api/jobs/list/fields:

CODE
[
    {
        "id": "id",
        "name": "Unique ID",
        "desc": "The globally unique string ID of the job, such as 'c2002' or 's773'",
        "type": "String",
        "cat": "Regular",
        "nullable": false,
        "isdata": true,
        "iscol": true,
        "iscoldef": false,
        "canquery": false,
        "cansort": false,
        "max": null,
        "width": null,
        "uifilter": 0
    },
    {
        "id": "jobid",
        "name": "Job ID",
        "desc": "The standard or codyt specific job id. For backwards compatibility.",
        "type": "Integer",
        "cat": "Regular",
        "nullable": false,
        "isdata": true,
        "iscol": true,
        "iscoldef": false,
        "canquery": true,
        "cansort": true,
        "max": null,
        "width": null,
        "uifilter": 0
    },
    {
        "id": "iscodyt",
        "name": "Project type",
        "desc": "Indicates if project is Standard or Codyt",
        "type": "Boolean",
        "cat": "Regular",
        "nullable": false,
        "isdata": true,
        "iscol": true,
        "iscoldef": true,
        "canquery": true,
        "cansort": true,
        "max": null,
        "width": null,
        "uifilter": 2
    },
    {
        "id": "status",
        "name": "Status Number",
        "desc": "Job status, numeric value",
        "type": "Integer",
        "cat": "Regular",
        "nullable": false,
        "isdata": true,
        "iscol": false,
        "iscoldef": false,
        "canquery": true,
        "cansort": true,
        "max": null,
        "width": null,
        "options": {
            "otype": "dic",
            "items": [
                {
                    "v": 0,
                    "t": "Draft"
                },
                {
                    "v": 1,
                    "t": "Not assigned"
                },
                {
                    "v": 2,
                    "t": "Inactive"
                },
                {
                    "v": 3,
                    "t": "Proposal"
                },
                {
                    "v": 4,
                    "t": "Not started"
                },
                {
                    "v": 5,
                    "t": "In progress"
                },
                {
                    "v": 6,
                    "t": "Completed"
                },
                {
                    "v": 7,
                    "t": "Approved"
                },
                {
                    "v": 8,
                    "t": "Closed"
                },
                {
                    "v": 9,
                    "t": "Proposal declined"
                },
                {
                    "v": 10,
                    "t": "Cancelled"
                }
            ]
        },
        "uifilter": 1
    },
	....





JavaScript errors detected

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

If this problem persists, please contact our support.