Skip to content

Field Options

FieldOption resources define the set of valid choices for a Field when Field.hasFixedOptions = true.

An FieldOption has human-readable FieldOption.value and an FieldOption.position which determines the order in which it appears in relation to the other FieldOption resources for a Field.

If Field.hierarchical = true then FieldOption.parent is the FieldOption which is the parent node of the FieldOption in the tree. FieldOption.position then determines the order in which the option appears in relation to the other options with the same FieldOption.parent.

The FieldOption resource intentionally does not include the list of child FieldOption resources. This is to prevent costly loading of large FieldOption tree structures. FieldOption.leaf and FieldOption.numberOfChildren properties can be used to determine the number of children for a node, but it is recommended to implement a combination of lazy-loading strategies using the GET Field Option and POST Field Option Searches resources for retrieval.

e.g. Doing a GET Field Option with an FieldOption.id value found in Asset.metadata.values will give the complete branch of the tree necessary in the context of the viewing that Asset via the FieldOption.parent property. For traversing down an FieldOption tree POST Field Option Searches can be used to first get all the top-level options and then each sub level as and when needed.

Searching allows you to find FieldOption resources in your Dash matching specific criteria

Criteria can be constructed based on direct comparison or pattern matching of a set of fixed FieldOption properties.

The logical operators AND, OR and NOT are provided to support complex queries based on multiple fields.

A list of sorts can also be provided to control the order in the which the results are returned.

Create a field option

Request

Create a new FieldOption resource adding it to the set of valid choices for an Field where Field.hasFixedOptions = true.

Security
bearerToken
Bodyapplication/jsonrequired
fieldIdstringrequired

The unique ID of the Field the FieldOption should belong to

Example:"a52b5315-15b8-417f-b742-d6902108bac1"
valuestringrequired

The human-readable value of the FieldOption

Example:"Folder A"
positioninteger

The 0-based position the FieldOption should occupy relative to the other options

Default:0
Example:2
parentIdstring or null

The FieldOption.id of the option above this one in the hierarchy

Default:null
curl -i -X POST \
  https://api-v2.dash.app/field-options \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "fieldId": "a52b5315-15b8-417f-b742-d6902108bac1",
    "value": "My Top Level Folder",
    "position": 3,
    "parentId": null
  }'

Responses

Success

Bodyapplication/json
resultobjectrequired
permittedActionsArray of objectsrequired

Permitted actions for FieldOption resources:

Response
{ "result": { "id": "1fc6d6c3-c42d-48e2-b0db-5d680a58ca52", "fieldId": "a52b5315-15b8-417f-b742-d6902108bac1", "value": "My Top Level Folder", "position": 0, "leaf": false, "parent": null }, "permittedActions": [] }