# ExpressionUnion

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

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

Union of expressions of different type.

Set exactly one member, the one that matches `Expression.type`.

- **Full name:** `MFiles.ExpressionUnion`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)
- **Nested types:** [`ExpressionUnion.UninitializedData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-UninitializedData), [`ExpressionUnion.PropertyValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-PropertyValueData), [`ExpressionUnion.IdSegmentData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-IdSegmentData), [`ExpressionUnion.StatusValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-StatusValueData), [`ExpressionUnion.FileValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-FileValueData), [`ExpressionUnion.TypedValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-TypedValueData), [`ExpressionUnion.AnyFieldData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-AnyFieldData), [`ExpressionUnion.PermissionsData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-PermissionsData)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-property_value"></a>`property_value` | [`ExpressionUnion.PropertyValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-PropertyValueData) (oneof data) | 1 | Expression for property values. |
| <a id="f-id_segment"></a>`id_segment` | [`ExpressionUnion.IdSegmentData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-IdSegmentData) (oneof data) | 2 | Expression for document ID segments. |
| <a id="f-status_value"></a>`status_value` | [`ExpressionUnion.StatusValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-StatusValueData) (oneof data) | 3 | Expression for status values such as Document ID or CheckedOutToUser. |
| <a id="f-file_value"></a>`file_value` | [`ExpressionUnion.FileValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-FileValueData) (oneof data) | 4 | Expression for file values such as file size. |
| <a id="f-typed_value"></a>`typed_value` | [`ExpressionUnion.TypedValueData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-TypedValueData) (oneof data) | 5 | Expression for values of specific data type. Lookup-typed values also specify the value list. |
| <a id="f-any_field"></a>`any_field` | [`ExpressionUnion.AnyFieldData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-AnyFieldData) (oneof data) | 6 | Expression for values of any field (any property, file name etc.). |
| <a id="f-permissions"></a>`permissions` | [`ExpressionUnion.PermissionsData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ExpressionUnion/index.md#t-PermissionsData) (oneof data) | 7 | Expression for permissions (ACL). |

<a id="used-in-fields"></a>

## Used in fields

- [`Expression.data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Expression/index.md#f-data): The expression data. Set the member that matches `type`.

<a id="t-UninitializedData"></a>

## Nested message UninitializedData

Uninitialized expression, used as default value. This value is never used in actual expressions and serves only as a placeholder for uninitialized expressions.

Full name: `MFiles.ExpressionUnion.UninitializedData`

No fields.

<a id="t-PropertyValueData"></a>

## Nested message PropertyValueData

Expression for property values.

Full name: `MFiles.ExpressionUnion.PropertyValueData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-PropertyValueData-property_def"></a>`property_def` | `int32` | 1 | The ID of the property definition whose value is compared, for example 0 (Name or title), 21 (Last modified) or 100 (Class). |
| <a id="t-PropertyValueData-data_function"></a>`data_function` | [`DataFunctionCall`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionCall/index.md) | 2 | Optional function applied to the value before the comparison, for example `DATA_FUNCTION_DAYS_FROM` to compare the age of a date in days. Unset compares the value as is. |
| <a id="t-PropertyValueData-parent_child_behavior"></a>`parent_child_behavior` | [`ParentChildBehavior`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ParentChildBehavior/index.md) | 3 | For hierarchical value lists: whether a match on a parent or child item also counts. Unset requires an exact match. Values: `PARENT_CHILD_BEHAVIOR_NONE` (0), `PARENT_CHILD_BEHAVIOR_INCLUDE_CHILD_VALUES` (1), `PARENT_CHILD_BEHAVIOR_INCLUDE_PARENT_VALUES` (2). |

<a id="t-IdSegmentData"></a>

## Nested message IdSegmentData

Expression for document ID segments.

Full name: `MFiles.ExpressionUnion.IdSegmentData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-IdSegmentData-segment_size"></a>`segment_size` | `int32` | 1 | The size of the document ID range of one segment. Typically 1000. |

<a id="t-StatusValueData"></a>

## Nested message StatusValueData

Expression for status values such as Document ID or CheckedOutToUser.

Value types that work with `CONDITION_TYPE_EQUAL`:

- `STATUS_TYPE_IS_DELETED`, `STATUS_TYPE_CHECKED_OUT`: Boolean.
- `STATUS_TYPE_OBJECT_TYPE`: a lookup (value list -11, item = object type ID), or a multi-select
  lookup to match any of several object types.
- `STATUS_TYPE_OBJECT_ID`: integer. `CONDITION_TYPE_GREATER_THAN` also works, for paging by object
  ID.

Full name: `MFiles.ExpressionUnion.StatusValueData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-StatusValueData-type"></a>`type` | [`StatusType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.StatusType/index.md) | 1 | The type of status information (e.g. check out user). |
| <a id="t-StatusValueData-data_function"></a>`data_function` | [`DataFunctionCall`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionCall/index.md) | 2 | Function that modifies the status value. |

<a id="t-FileValueData"></a>

## Nested message FileValueData

Expression for file values such as file size.

Full name: `MFiles.ExpressionUnion.FileValueData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-FileValueData-type"></a>`type` | [`FileValueType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileValueType/index.md) | 1 | The type of file information (e.g. file name). Values: `FILE_VALUE_TYPE_HAS_FILES` (0), `FILE_VALUE_TYPE_FILE_NAME` (1), `FILE_VALUE_TYPE_FILE_SIZE` (2), `FILE_VALUE_TYPE_FILE_ID` (3), `FILE_VALUE_TYPE_CREATION_TIME` (4), `FILE_VALUE_TYPE_CHANGE_TIME` (5), `FILE_VALUE_TYPE_LINKED_TO_EXTERNAL_LOCATION` (6), `FILE_VALUE_TYPE_LINKED_EXTERNAL_LOCATION_ID` (7), `FILE_VALUE_TYPE_HAS_DUPLICATES` (8). |

<a id="t-TypedValueData"></a>

## Nested message TypedValueData

Expression for values of specific data type. Lookup-typed values also specify the value list.

Matches a value in any property of the given data type. With `DATATYPE_MULTI_SELECT_LOOKUP` (or
`DATATYPE_LOOKUP`) and `value_list`, the condition finds objects that refer to the given item in
any property, single- or multi-select.

Full name: `MFiles.ExpressionUnion.TypedValueData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-TypedValueData-datatype"></a>`datatype` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | 1 | The data type of the values to match. |
| <a id="t-TypedValueData-value_list"></a>`value_list` | `int32` | 2 | With `DATATYPE_LOOKUP` or `DATATYPE_MULTI_SELECT_LOOKUP`, the value list or object type whose item the objects refer to. Both data types find objects that refer to the item through a lookup or a multi-select lookup property. |
| <a id="t-TypedValueData-data_function"></a>`data_function` | [`DataFunctionCall`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionCall/index.md) | 3 | Function that modifies the typed value. |
| <a id="t-TypedValueData-parent_child_behavior"></a>`parent_child_behavior` | [`ParentChildBehavior`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ParentChildBehavior/index.md) | 4 | Parent-child behaviour, used within hierarchic value lists. Values: `PARENT_CHILD_BEHAVIOR_NONE` (0), `PARENT_CHILD_BEHAVIOR_INCLUDE_CHILD_VALUES` (1), `PARENT_CHILD_BEHAVIOR_INCLUDE_PARENT_VALUES` (2). |

<a id="t-AnyFieldData"></a>

## Nested message AnyFieldData

Expression for values of any field (any property, file name etc.).

A full-text search. Use it with `CONDITION_TYPE_CONTAINS` and a non-empty text value.

Full name: `MFiles.ExpressionUnion.AnyFieldData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-AnyFieldData-options"></a>`options` | [`FTSFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FTSFLAGS/index.md) | 1 | Full-text search flags. Set `search_metadata`, `search_filedata` or both; with neither, the search fails with "Invalid search condition." See [FTSFLAGS](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FTSFLAGS/index.md). |

<a id="t-PermissionsData"></a>

## Nested message PermissionsData

Expression for permissions (ACL).

Full name: `MFiles.ExpressionUnion.PermissionsData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-PermissionsData-type"></a>`type` | [`PermissionsExpressionType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.PermissionsExpressionType/index.md) | 1 | A more detailed type specification of the permissions expression. Values: `PERMISSIONS_EXPRESSION_TYPE_ACL` (0), `PERMISSIONS_EXPRESSION_TYPE_VISIBLE_TO` (1), `PERMISSIONS_EXPRESSION_TYPE_EDITABLE_BY` (2), `PERMISSIONS_EXPRESSION_TYPE_PERMISSIONS_CHANGEABLE_BY` (3), `PERMISSIONS_EXPRESSION_TYPE_FULL_CONTROL_BY` (4), `PERMISSIONS_EXPRESSION_TYPE_DELETABLE_BY` (5), `PERMISSIONS_EXPRESSION_TYPE_OBJECTS_ATTACHABLE_TO_THIS_ITEM_BY` (6). |
