# PropertyDef

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

A property definition: a property that objects can have, with its data type and, for lookup
properties, the value list or object type its values come from.

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

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

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-id"></a>`id` | `int32` | 1 | The property definition ID. Built-in property definitions (0 Name or title, 20 Created, 100 Class, ...) have the same ID in every vault. IDs 1-19 are never used by real property definitions. |
| <a id="f-name"></a>`name` | `string` | 2 | The name of the property. |
| <a id="f-tooltip"></a>`tooltip` | `string` | 3 | The tip text of this property. |
| <a id="f-data_type"></a>`data_type` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | 4 | The data type of the values. Lookup properties use `DATATYPE_LOOKUP` (one item) or `DATATYPE_MULTI_SELECT_LOOKUP` (several items). |
| <a id="f-content_type"></a>`content_type` | [`ContentType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ContentType/index.md) | 5 | Content type (sub-datatype). Values: `CONTENT_TYPE_GENERIC` (0), `CONTENT_TYPE_EMAIL_ADDRESS` (1), `CONTENT_TYPE_URL` (2), `CONTENT_TYPE_RTF` (3), `CONTENT_TYPE_HTML` (4). |
| <a id="f-is_based_on_value_list"></a>`is_based_on_value_list` | `bool` | 7 | True for lookup properties; `value_list` then names the list. Test this flag, not `value_list != 0`: 0 is a valid list ID (the Document object type). |
| <a id="f-enable_automatic_permissions"></a>`enable_automatic_permissions` | `bool` | 8 | True to allow automatic permissions via this property def. |
| <a id="f-is_conflict_reference"></a>`is_conflict_reference` | `bool` | 9 | True if this is the conflict property of the object type in `value_list`. |
| <a id="f-disallow_as_grouping_level"></a>`disallow_as_grouping_level` | `bool` | 10 | True to disallow using this property def as a grouping level in views. |
| <a id="f-value_list"></a>`value_list` | `int32` | 11 | With `is_based_on_value_list`, the ID of the value list or object type whose items are the property's values. |
| <a id="f-value_list_item_filter"></a>`value_list_item_filter` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | 12 | A static filter on the items of `value_list`. The server applies it when this property is passed as `filtering_property_def` or `LookupItemRequest.property_def`; such conditions cannot be sent in `search_conditions` directly. |
| <a id="f-update_type"></a>`update_type` | [`UpdateType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.UpdateType/index.md) | 13 | The update behaviour of the property. Values: `UPDATE_TYPE_NORMAL` (0), `UPDATE_TYPE_SET_BY_SERVER` (1), `UPDATE_TYPE_SET_BY_CLIENT_CODE` (2). |
| <a id="f-automatic_value_type"></a>`automatic_value_type` | [`AutomaticValueType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.AutomaticValueType/index.md) | 14 | Defines the type of the automatic value of this field, if any. Values: `AUTOMATIC_VALUE_TYPE_NONE` (0), `AUTOMATIC_VALUE_TYPE_CALCULATE_WITH_TEMPLATE` (1), `AUTOMATIC_VALUE_TYPE_CALCULATED_WITH_CODE` (2), `AUTOMATIC_VALUE_TYPE_FIXED_VALUE_WITH_INCREMENT` (3), `AUTOMATIC_VALUE_TYPE_FIXED_VALUE_WITH_CODE` (4). |
| <a id="f-default_value"></a>`default_value` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | 15 | If set, specifies a fixed default value for this property. |
| <a id="f-icon"></a>`icon` | [`Bytes`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Bytes/index.md) | 16 | If set, contains an icon in .ICO format (contains multiple sizes and color depths). |
| <a id="f-is_predefined"></a>`is_predefined` | `bool` | 17 | True if this is a predefined PropertyDef. Predefined PropertyDefs cannot be deleted and modifying them is restricted. |
| <a id="f-allow_for_all_object_types"></a>`allow_for_all_object_types` | `bool` | 18 | True if this property definition can be used with all object types. |
| <a id="f-is_owner"></a>`is_owner` | `bool` | 19 | True if this is the owner property of the object type in `value_list`. |
| <a id="f-is_default"></a>`is_default` | `bool` | 20 | True if this is the default property of the object type in `value_list` (`ValueList.default_property_def`). |
| <a id="f-owner_property_def_info"></a>`owner_property_def_info` | [`OwnerPropertyDef`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OwnerPropertyDef/index.md) | 21 | For a lookup property, the property whose value limits this property's values. For example, Workflow State (39) is limited by Workflow (38). A `property_def` of -106 means that the owner property is determined automatically. |
| <a id="f-object_type"></a>`object_type` | `int32` | 22 | If `allow_for_all_object_types` is false, the object type whose objects use this property; otherwise ignored. |
| <a id="f-acl"></a>`acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | 23 | If set, specifies the ACL that defines the visibility and editability of this property in objects. |
| <a id="f-property_def_permissions"></a>`property_def_permissions` | [`PropertyDefPermissionsForClient`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDefPermissionsForClient/index.md) | 32 | What the caller may do with values of this property: see them and edit them. Set when the property definition has permissions. |
| <a id="f-value_list_sorting_type"></a>`value_list_sorting_type` | [`VLSortingType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.VLSortingType/index.md) | 24 | The sorting type of value list items. Values: `VLSORTING_TYPE_BY_DISPLAY_NAME` (0), `VLSORTING_TYPE_BY_EXTERNAL_ID` (1). |
| <a id="f-value_list_sort_ascending"></a>`value_list_sort_ascending` | `bool` | 25 | True to sort in ascending order, false to sort in descending order. |
| <a id="f-validation_type"></a>`validation_type` | [`ValidationType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ValidationType/index.md) | 26 | How values are validated; `validation_string` holds the rule. Values: `VALIDATION_TYPE_NONE` (0), `VALIDATION_TYPE_REGEX` (1), `VALIDATION_TYPE_CODE` (2). |
| <a id="f-validation_string"></a>`validation_string` | `string` | 27 | The validation rule; its meaning depends on `validation_type`. |
| <a id="f-formatting_type"></a>`formatting_type` | [`FormattingType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FormattingType/index.md) | 28 | How values are formatted; `formatting_string` holds the format. Values: `FORMATTING_TYPE_NONE` (0). |
| <a id="f-formatting_string"></a>`formatting_string` | `string` | 29 | The format; its meaning depends on `formatting_type`. |
| <a id="f-guid"></a>`guid` | `string` | 30 | The GUID of the property definition, with braces. |
| <a id="f-options"></a>`options` | [`PROPERTYDEFFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PROPERTYDEFFLAGS/index.md) | 31 | Flags such as `can_use_in_search`. See [PROPERTYDEFFLAGS](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PROPERTYDEFFLAGS/index.md). |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCPropertyDefs.GetPropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDef/index.md): Gets one property definition by ID.
- [IRPCPropertyDefs.GetPropertyDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDefs/index.md): Gets all property definitions that the user is allowed to see.

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

## Used in fields

- [`PropertyDefAdmin.property_def`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDefAdmin/index.md#f-property_def): Basic data.
- [`GetPropertyDefsResponse.property_defs`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDefs/index.md#response): The property definitions the user can see, or empty if `known_version` was current. See [PropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDef/index.md).
- [`GetPropertyDefResponse.value`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDef/index.md#response): The property definition. See [PropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDef/index.md).
