# DataFunction

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

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

Functions that operate on a property value, for example.

- **Full name:** `MFiles.DataFunction`
- **Proto file:** [`mfiles/enums.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/enums.proto)

<a id="values"></a>

## Values

| Name | Number | Description |
|---|---|---|
| <a id="v-DATA_FUNCTION_NO_OP"></a>`DATA_FUNCTION_NO_OP` | 0 | Returns the data without modifying it. |
| <a id="v-DATA_FUNCTION_YEAR"></a>`DATA_FUNCTION_YEAR` | 1 | Gets the year of a date or timestamp value (e.g. 2004). |
| <a id="v-DATA_FUNCTION_MONTH"></a>`DATA_FUNCTION_MONTH` | 2 | Gets the month of a date or timestamp value (e.g. "02"). |
| <a id="v-DATA_FUNCTION_YEAR_AND_MONTH"></a>`DATA_FUNCTION_YEAR_AND_MONTH` | 3 | Gets the year and month of a date or timestamp value (e.g. "2004-02"). |
| <a id="v-DATA_FUNCTION_DATE"></a>`DATA_FUNCTION_DATE` | 4 | Gets the date part of a date or timestamp value (e.g. 2004-02-15). |
| <a id="v-DATA_FUNCTION_DAYS_FROM"></a>`DATA_FUNCTION_DAYS_FROM` | 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="v-DATA_FUNCTION_DAYS_TO"></a>`DATA_FUNCTION_DAYS_TO` | 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="v-DATA_FUNCTION_INTEGER_SEGMENT"></a>`DATA_FUNCTION_INTEGER_SEGMENT` | 7 | Gets the integer segment of a value (an integer number or a real number) based on a defined segment size. |
| <a id="v-DATA_FUNCTION_LEFT_CHARACTERS"></a>`DATA_FUNCTION_LEFT_CHARACTERS` | 8 | Gets a defined amount of left characters from a text or typed value. |
| <a id="v-DATA_FUNCTION_INITIAL_CHARACTER_GROUP"></a>`DATA_FUNCTION_INITIAL_CHARACTER_GROUP` | 9 | Gets an initial character group from a text or typed value. |

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

## Used in fields

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