# IRPCSearch.SearchReferencedValueListItems

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Search](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/SearchReferencedValueListItems/

Badges: `Vault API / core` `write` `session or assertion`

Gets value list items that are referenced by one or more documents (possibly limiting the set of documents with conditions) in ID order.

- **Service:** [Search](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/index.md) `MFiles.IRPCSearch`
- **gRPC method:** `/MFiles.IRPCSearch/SearchReferencedValueListItems`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/search-referenced-value-list-items`
- **Request:** [`SearchReferencedValueListItemsRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/SearchReferencedValueListItems/index.md#request)
- **Response:** [`SearchReferencedValueListItemsResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSearch/SearchReferencedValueListItems/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** write
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

Returns the items of `value_list` that at least one matching object refers to, in ascending ID
order, `batch_size` items at a time. For the next batch, pass the ID of the last item received
in `last_received_item_id`. Only the first condition array in `utf8szconds` is used.

<a id="request"></a>

## Request: SearchReferencedValueListItemsRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `value_list` | `int32` | ID of the valuelist. |
| `last_received_item_id` | `uint32` | The last valuelist item id that was received by the client. 0 for first call. |
| `batch_size` | `uint32` | The maximum number of items to return. Set a value greater than 0: a request with 0 returns no items. |
| `utf8szconds[]` | repeated [`SearchConditionArray`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchConditionArray/index.md) | The conditions that the referring objects must match. Only the first condition array is used; all of its conditions must match. |
| `utf8szconds[].value[]` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | The conditions. All of them must match. |
| `utf8szconds[].value[].expression` | [`Expression`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Expression/index.md) | The left side of the condition: what is evaluated for each object, such as a property value, a status value or any field (full-text search). |
| `utf8szconds[].value[].type` | [`ConditionType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ConditionType/index.md) | The comparison operator. |
| `utf8szconds[].value[].value` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | The right side of the condition: the value to compare with. Its data type must suit the expression, for example a lookup for a lookup property, Boolean for `STATUS_TYPE_IS_DELETED`. |

<a id="response"></a>

## Response: SearchReferencedValueListItemsResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `pvlitems[]` | repeated [`ValueListItem`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ValueListItem/index.md) | Resulting valuelist items. |
| `pvlitems[].item_info` | [`ItemInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ItemInfo/index.md) | The item's identity and name: `obj_id.type` is the value list ID, `obj_id.item_id.internal_id` the item ID (unique within the list only), plus `name`, `guid`, `external_id` and flags. `options.is_deleted` marks a deleted item. |
| `pvlitems[].item_info.obj_id` | [`ObjID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjID/index.md) | The object id or value list item id. Includes the object type or value list id. |
| `pvlitems[].item_info.name` | `string` | The name of the item. |
| `pvlitems[].item_info.external_id_status` | [`ExtIDStatus`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ExtIDStatus/index.md) | The status of this item's external ID. Values: `EXT_IDSTATUS_UNKNOWN` (0), `EXT_IDSTATUS_EXTERNAL` (1), `EXT_IDSTATUS_INTERNAL` (2), `EXT_IDSTATUS_DISCARDED` (3), `EXT_IDSTATUS_NOT_AVAILABLE` (4), `EXT_IDSTATUS_EXTERNAL_REDUCED` (5). |
| `pvlitems[].item_info.external_id` | `string` | The external ID (display ID) of this item. unset means that the external ID is the same as the internal ID. |
| `pvlitems[].item_info.guid` | `string` | GUID for the item. |
| `pvlitems[].item_info.options` | [`ITEMFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ITEMFLAGS/index.md) | Bit flags that provide additional information on the item (e.g. is the object deleted). |
| `pvlitems[].item_info.external_repository_icon_id` | `string` | The ID of the item's icon. |
| `pvlitems[].has_parent` | `bool` | True if the item has a parent item in the same (hierarchical) list. |
| `pvlitems[].has_owner` | `bool` | True if the item belongs to an item of the owner list (`ValueList.owner_object_type`). |
| `pvlitems[].parent_id` | `int32` | With `has_parent`, the item ID of the parent item; otherwise ignored. |
| `pvlitems[].owner_id` | `int32` | With `has_owner`, the item ID of the owner item in the owner list. |
| `pvlitems[].owner_name` | `string` | The name of the owner item. |
| `pvlitems[].automatic_permissions` | [`AutomaticPermissions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AutomaticPermissions/index.md) | If set, specifies the automatic permissions for an object for which the user selects this item. |
| `pvlitems[].automatic_permissions.permissions` | [`NamedACL`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedACL/index.md) | The automatic permissions for an object for which the user selects this item. |
| `pvlitems[].automatic_permissions.is_default` | `bool` | True if these automatic permissions are not private i.e. they are not directly specified for (owned by) this item but they come from somewhere else, e.g. from the default/common automatic permissions of the object type. |
| `pvlitems[].automatic_permissions.use_object_permissions` | `bool` | If true the object/item's own permissions are used as its automatic permissions. |
| `pvlitems[].icon` | [`Bytes`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Bytes/index.md) | If set, contains the icon of this item in .ICO format. |
| `pvlitems[].icon.value` | `bytes` | Array of bytes. |
