# IRPCFolderUISettings.SetFolderSelection

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) > [Folder UI settings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCFolderUISettings/index.md)

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

Badges: `Vault API / standard` `write` `session` `idempotent` `returns metadata structure version`

Replaces the calling user's folder selection for one view level: the folders that the user
always wants to see on a level whose listing is cut by the folder limit.

- **Service:** [Folder UI settings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCFolderUISettings/index.md) `MFiles.IRPCFolderUISettings`
- **gRPC method:** `/MFiles.IRPCFolderUISettings/SetFolderSelection`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/set-folder-selection`
- **Request:** [`SetFolderSelectionRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCFolderUISettings/SetFolderSelection/index.md#request)
- **Response:** [`SetFolderSelectionResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCFolderUISettings/SetFolderSelection/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

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

## Remarks

- Not available on servers where the feature is not enabled: fails with "Not implemented."
  ("Folder selection is not enabled on this server.").
- Requires a vault session of a named user; anonymous sessions get "Access denied.".
- `folder_location` must be a view folder followed only by property folders, and the level it
  leads to must group by a property or value; other locations fail.
- `folders` are the property folder values as the listing returned them. Lookups are stored by
  item ID only, so a renamed item stays selected. Empty values, multi-select lookups and
  duplicates are rejected. The selection may not have more folders than the level's folder
  limit.
- An empty `folders` clears the selection. The whole selection is replaced; a failed call leaves
  the stored selection unchanged.

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

## Request: SetFolderSelectionRequest

Replaces the calling user's folder selection for one folder location. The selection always belongs to
the session's user, so the request has no user field. An empty folder array clears the selection.

> 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 |
|---|---|---|
| `folder_location[]` | repeated [`Folder`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Folder/index.md) | The path from the vault root to the parent of the level whose folders are selected: a view folder followed by property folders. |
| `folder_location[].type` | [`FolderType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FolderType/index.md) | The type of the folder, for example `FOLDER_TYPE_VIEW_FOLDER` or `FOLDER_TYPE_PROPERTY_FOLDER`. Values: `FOLDER_TYPE_UNKNOWN` (0), `FOLDER_TYPE_ANY_FOLDER` (1), `FOLDER_TYPE_VIEW_FOLDER` (2), `FOLDER_TYPE_PROPERTY_FOLDER` (3), `FOLDER_TYPE_TRADITIONAL_FOLDER` (4), `FOLDER_TYPE_SEARCH_FOLDER` (5), `FOLDER_TYPE_EXTERNAL_VIEW_FOLDER` (6). |
| `folder_location[].data` | [`FolderInfoUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md) | Additional folder type -specific information as a union. |
| `folder_location[].data.any_folder` | [`FolderInfoUnion.AnyFolderData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md#t-AnyFolderData) (oneof data) | Any folder type. |
| `folder_location[].data.view_folder` | [`FolderInfoUnion.ViewFolderData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md#t-ViewFolderData) (oneof data) | View folder type. |
| `folder_location[].data.property_folder` | [`FolderInfoUnion.PropertyFolderData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md#t-PropertyFolderData) (oneof data) | Property (virtual) folder type. |
| `folder_location[].data.traditional_folder` | [`FolderInfoUnion.TraditionalFolderData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md#t-TraditionalFolderData) (oneof data) | Traditional folder type. |
| `folder_location[].data.search_folder` | [`FolderInfoUnion.SearchFolderData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md#t-SearchFolderData) (oneof data) | Search folder (extended view folder) type. |
| `folder_location[].data.external_view_folder` | [`FolderInfoUnion.ExternalViewFolderData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FolderInfoUnion/index.md#t-ExternalViewFolderData) (oneof data) | External view folder type. |
| `folders[]` | repeated [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | The complete new selection, as the folder values that the listing returned. Empty clears it. |
| `folders[].is_null_value` | `bool` | True if the value is empty. `data` is then unset. |
| `folders[].type` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | The data type of the value. |
| `folders[].data` | [`TypedValueUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValueUnion/index.md) | The value, in the member that matches `type`. Unset for an empty value. |
| `folders[].data.text` | `string` (oneof data) | The value of `DATATYPE_TEXT`. |
| `folders[].data.integer` | `int32` (oneof data) | The value of `DATATYPE_INTEGER`. |
| `folders[].data.real_number` | `double` (oneof data) | The value of `DATATYPE_REAL_NUMBER`. |
| `folders[].data.decimal_number` | `string` (oneof data) | Fixed precision number. |
| `folders[].data.date` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | The value of `DATATYPE_DATE`: midnight UTC of the date. |
| `folders[].data.time` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | Time. |
| `folders[].data.timestamp` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | The value of `DATATYPE_TIMESTAMP`, in UTC. |
| `folders[].data.boolean` | `bool` (oneof data) | The value of `DATATYPE_BOOLEAN`. |
| `folders[].data.lookup` | [`Lookup`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Lookup/index.md) (oneof data) | The value of `DATATYPE_LOOKUP`: one value list item or object. |
| `folders[].data.multi_select_lookup` | [`MultiSelectLookup`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.MultiSelectLookup/index.md) (oneof data) | The value of `DATATYPE_MULTI_SELECT_LOOKUP`: any number of value list items or objects. |
| `folders[].data.integer64` | `int64` (oneof data) | Integer (8 bytes). |
| `folders[].data.filetime` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | FILETIME (64-bit integer). |
| `folders[].data.multi_line_text` | `string` (oneof data) | The value of `DATATYPE_MULTI_LINE_TEXT`. |
| `folders[].data.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) (oneof data) | Access Control List. |

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

## Response: SetFolderSelectionResponse

A structure that specifies the response type for the SetFolderSelection method.

> 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 |
|---|---|---|
| `has_selected_folders` | `bool` | True when the caller has a stored selection for the location after the call. |
