Skip to main content

settings/customfields/{id}/options/items (PUT)

The present method lets you set the available options of a custom field.

Wordbee supports pick list custom fields. Such custom fields define different options from which a user can select from. Use settings/customfields to enumerate all fields and see which ones are pick lists (look for “Combo”). Please note that custom fields with options come in two flavors:

  • List of strings: Most field types only allow to configure a list of strings. This concerns fields Combo, ComboEditable and ComboMultiSelect.

  • List of strings with meta data: Fields of type ComboAuto are like regular pick lists but with a nice twist: You can also specify a list of strings but also add meta-data to each string. Read more.

URL

CODE
(PUT) /api/settings/customfields/{id}/options/items

PARAMETERS

The URL has these parameters:

id

The unique ID of the custom field. Easily find all your fields' IDs with: settings/customfields

Note: The ID is of the following format. The first number identifies the object to which the field relates (such as project, job, person, segment, etc.). The second number is a sequential field number.

CODE
2-5

string, Mandatory

The BODY must include a JSON array with the options. Each array element has these properties:

value

The mandatory option value. This is the text that is shown in the pick list and selected by a user.

Maximum length is 200 characters,

string, Mandatory

meta

An optional array of meta data. Meta data might look like this.

CODE
"meta": [
    { "key": "author", "title": "Author", "value": "John Updike", "show": true },
    { "key": "reader", "title": "Reader", "value": "Oh my god", "show": true },
    { "key": null, title": "ID", "value": "2121", "show": false }
]

See below for the meta data properties.

Note: Meta data are simply disregarded if the custom field does not support options with meta data. No error will be shown.

object[]?, Optional

meta.key

An optional key assigned to the data.

In certain areas, meta data can be leveraged in Wordbee Translator and be copied to other custom fields of an order or project. This feature mandates that you assign a key.

Maximum length is 50 characters.

string?, Optional

meta.title

A mandatory title of the meta data.

string, Mandatory

meta.value

The actual value. Can be null.

Maximum length is 200 characters,

string?, Mandatory

meta.show

An optional indicator if this field is shown to users in the UI or should not be shown.

If not specified then the default value is true.

bool, Optional

RESULTS

The method returns no data.

EXAMPLES

A typical payload could be:

CODE
[
    {
        "value": "10009",
        "meta": [ 
            { "title": "Project", "value": "Project A-10009 - Henderson", "show": true }
        ]
    },
    {
        "value": "10054",
        "meta": [ 
            { "title": "Project", "value": "Project X-33223 - IBM", "show": true },
            { "title": "Owner", "value": "John", "key": "owner", "show": false }  
        ]
    },
    {
        "value": "20092",
        "meta": []
    }
]

A typical payload to set options for a pick list not supporting meta data:

CODE
[
  { "value": "London" },
  { "value": "Paris" }
]

JavaScript errors detected

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

If this problem persists, please contact our support.