# DataFunctionUnion

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.DataFunctionUnion/

Union of data functions of different type.

- **Full name:** `MFiles.DataFunctionUnion`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)
- **Nested types:** [`DataFunctionUnion.NoOpData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-NoOpData), [`DataFunctionUnion.YearData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-YearData), [`DataFunctionUnion.MonthData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-MonthData), [`DataFunctionUnion.YearAndMonthData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-YearAndMonthData), [`DataFunctionUnion.DateData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-DateData), [`DataFunctionUnion.DaysFromData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-DaysFromData), [`DataFunctionUnion.DaysToData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-DaysToData), [`DataFunctionUnion.IntegerSegmentData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-IntegerSegmentData), [`DataFunctionUnion.LeftCharactersData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-LeftCharactersData), [`DataFunctionUnion.InitialCharacterGroupData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-InitialCharacterGroupData)

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

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-year"></a>`year` | [`DataFunctionUnion.YearData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-YearData) (oneof data) | 1 | Gets the year of a date or timestamp value (e.g. 2004). |
| <a id="f-month"></a>`month` | [`DataFunctionUnion.MonthData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-MonthData) (oneof data) | 2 | Gets the month of a date or timestamp value (e.g. "02"). |
| <a id="f-year_and_month"></a>`year_and_month` | [`DataFunctionUnion.YearAndMonthData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-YearAndMonthData) (oneof data) | 3 | Gets the year and month of a date or timestamp value (e.g. "2004-02"). |
| <a id="f-date"></a>`date` | [`DataFunctionUnion.DateData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-DateData) (oneof data) | 4 | Gets the date part of a date or timestamp value (e.g. 2004-02-15). |
| <a id="f-days_from"></a>`days_from` | [`DataFunctionUnion.DaysFromData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-DaysFromData) (oneof data) | 5 | Gets the difference of the current timestamp and a specified date or timestamp value as the number of days (e.g. 8 or -10). |
| <a id="f-days_to"></a>`days_to` | [`DataFunctionUnion.DaysToData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-DaysToData) (oneof data) | 6 | Gets the difference of a specified date or timestamp value and the current timestamp as the number of days (e.g. 10 or -8). |
| <a id="f-integer_segment"></a>`integer_segment` | [`DataFunctionUnion.IntegerSegmentData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-IntegerSegmentData) (oneof data) | 7 | Gets the integer segment of a value (an integer number or a real number) based on a defined segment size. |
| <a id="f-left_characters"></a>`left_characters` | [`DataFunctionUnion.LeftCharactersData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-LeftCharactersData) (oneof data) | 8 | Gets a defined amount of left characters from a text or typed value. |
| <a id="f-initial_character_group"></a>`initial_character_group` | [`DataFunctionUnion.InitialCharacterGroupData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionUnion/index.md#t-InitialCharacterGroupData) (oneof data) | 9 | Gets an initial character group from a text or typed value. |

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

## Used in fields

- [`DataFunctionCall.data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DataFunctionCall/index.md#f-data): The data.

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

## Nested message NoOpData

Returns the data without modifying it.

Full name: `MFiles.DataFunctionUnion.NoOpData`

No fields.

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

## Nested message YearData

Gets the year of a date or timestamp value (e.g. 2004).

Full name: `MFiles.DataFunctionUnion.YearData`

No fields.

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

## Nested message MonthData

Gets the month of a date or timestamp value (e.g. "02").

Full name: `MFiles.DataFunctionUnion.MonthData`

No fields.

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

## Nested message YearAndMonthData

Gets the year and month of a date or timestamp value (e.g. "2004-02").

Full name: `MFiles.DataFunctionUnion.YearAndMonthData`

No fields.

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

## Nested message DateData

Gets the date part of a date or timestamp value (e.g. 2004-02-15).

Full name: `MFiles.DataFunctionUnion.DateData`

No fields.

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

## Nested message DaysFromData

Gets the difference of the current timestamp and a specified date or timestamp value as the number of days (e.g. 8 or -10).

Full name: `MFiles.DataFunctionUnion.DaysFromData`

No fields.

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

## Nested message DaysToData

Gets the difference of a specified date or timestamp value and the current timestamp as the number of days (e.g. 10 or -8).

Full name: `MFiles.DataFunctionUnion.DaysToData`

No fields.

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

## Nested message IntegerSegmentData

Gets the integer segment of a value (an integer number or a real number) based on a defined segment size.

Full name: `MFiles.DataFunctionUnion.IntegerSegmentData`

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

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

## Nested message LeftCharactersData

Gets a defined amount of left characters from a text or typed value.

Full name: `MFiles.DataFunctionUnion.LeftCharactersData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-LeftCharactersData-count"></a>`count` | `uint32` | 1 | The number of characters to extract from the beginning of the value. |

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

## Nested message InitialCharacterGroupData

Gets an initial character group from a text or typed value.

Full name: `MFiles.DataFunctionUnion.InitialCharacterGroupData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-InitialCharacterGroupData-lcid"></a>`lcid` | `uint32` | 1 | The locale used to form the initial character group of a string. 0 uses the locale of the server. |
