A pick list is a type of custom field within a Job. It contains a set of pre-defined items a user can choose from when filling out the custom field.
vWork supports both single value pick lists where a user can only choose one value, as well as multi-value pick lists where user's can select more than one value. Any of the pick lists defined in the account can be set to either single or multi-value when they are added to a job. You can also set a default value for a pick list when you add it to a job.
The following calls allow you to administer the pick lists that are available in your account.
Here are the fields you can use when making a pick list request:
| Name | Type | Description |
|---|---|---|
| name | String | A human readable name used to identify the pick list in the vWork admin. |
| pick_list_items | Array | An array of values to populate the pick list |
| pick_list_item.value | String | The value to include in the pick list |
When retrieving a pick list from vWork, you may also see these additional fields in the response:
| Name | Type | Description |
|---|---|---|
| id | Integer | The unique identifier for this pick list. Auto-generated by vWork. |
| created_at | DateTime | The date and time when this pick list was created. Format: ISO 8601. |
| updated_at | DateTime | The date and time when this pick list was last updated. Format: ISO 8601. |
| pick_list_items | Array | Array containing all items of that pick list. |
| pick_list_item | Object | One pick list item object. |
| pick_list_item.id | Integer | The unique identifier for this pick list item. Auto-generated by vWork. |
| pick_list_item.value | String | The text for this item. |
| pick_list_item.created_at | DateTime | The date and time when this pick list item was created. Format: ISO 8601. |
| pick_list_item.updated_at | DateTime | The date and time when this pick list item was last updated. Format: ISO 8601. |
Creates a pick list in vWork. The response includes the pick list’s unique id assigned to it by vWork. This ID needs to be included when adding a pick list custom field to a job.
curl -i -X POST \
'https://api.vworkapp.com/v5/pick_lists.xml?api_key=string&api_key=YOUR_API_KEY_HERE' \
-H 'Accept-Encoding: gzip' \
-H 'Content-Type: application/xml; charset=utf-8' \
-d '<?xml version="1.0" encoding="utf-8"?>
<pick_list>
<name>Package Status</name>
<pick_list_items type="array">
<pick_list_item>
<value>Delivered</value>
</pick_list_item>
<pick_list_item>
<value>Not delivered</value>
</pick_list_item>
</pick_list_items>
</pick_list>'<?xml version="1.0" encoding="utf-8"?>
<pick_list>
<id>1234</id>
<name>Package Status</name>
<created_at>2012-10-15T20:53:38+00:00</created_at>
<updated_at>2012-10-15T20:53:38+00:00</updated_at>
<pick_list_items type="array">
<pick_list_item>
<id>2345</id>
<value>Delivered</value>
<created_at>2012-10-15T20:53:38+00:00</created_at>
<updated_at>2012-10-15T20:53:38+00:00</updated_at>
</pick_list_item>
<pick_list_item>
<id>2346</id>
<value>Not delivered</value>
<created_at>2012-10-15T20:53:38+00:00</created_at>
<updated_at>2012-10-15T20:53:38+00:00</updated_at>
</pick_list_item>
</pick_list_items>
</pick_list>