Last modified on December 30, 2013 at 4:03 pm
Overview
To remove an option from a userfield, you can send an HTTP PUT request to the userfield URL with a JSON object containing an updated options property, omitting the option you wish to remove.
The options property consists of an array of objects with two possible properties: a string name and a boolean selected flag. The name property must be provided for every option. Dropdown lists and radiobutton inputs may have only one option with selected set to true; checkboxes-type userfields are not limited in how many options can be selected. Because options is a required field, there must always be at least one option provided.
Note that you are not limited to updating one property at a time; all fields that are valid for a particular userfield type may be updated in a single request. All fields not specified will retain their value. See the Userfield Object Reference for a list of all the object’s fields.
Example
This example shows the request-response sequence when updating the options property on a userfield. This will replace the current set of options with two options, the second of which is selected by default.
Request
PUT /dc/api/v5/userfields/8da97a97a92efd18dcbc12876a4510e HTTP/1.1 Host: org.digitalchalk.com Content-type: application/json Accept: application/json { "options": [ { "name": "Option 1" }, { "name": "Option 2", "selected": true }, ] }
Response
HTTP/1.1 204 No Content