# IRPCPropertyDefs.GetPropertyDef

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) > [Property definitions and classes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/index.md)

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

Badges: `Vault API / core` `write` `session or assertion` `returns metadata structure version`

Gets one property definition by ID.

- **Service:** [Property definitions and classes](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/index.md) `MFiles.IRPCPropertyDefs`
- **gRPC method:** `/MFiles.IRPCPropertyDefs/GetPropertyDef`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-property-def`
- **Request:** [`GetPropertyDefRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDef/index.md#request)
- **Response:** [`GetPropertyDefResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefs/GetPropertyDef/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** write
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** no
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

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

## Remarks

- Requires a vault session. No special vault rights are needed.
- Fails with the error message "You can't get access to the property ..." both when the ID
  does not exist and when the user is not allowed to see the property definition. IDs 1-19
  are never real property definitions (see
  [SearchValueListItemsWithPermissions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/SearchValueListItemsWithPermissions/index.md)
  for their use in value list item searches).
- `property_def_permissions` is set only when the property definition has its own permissions.
- Cacheable by metadata structure version.

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

## Request: GetPropertyDefRequest

> 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 |
|---|---|---|
| `property_def` | `int32` | The ID of the property definition. |
| `icons` | `bool` | Ignored by the server. |

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

## Response: GetPropertyDefResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page. Fields marked (recursive) refer to a type already on their path.

| Field | Type | Description |
|---|---|---|
| `value` | [`PropertyDef`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDef/index.md) | The property definition. See [PropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDef/index.md). |
| `value.id` | `int32` | 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. |
| `value.name` | `string` | The name of the property. |
| `value.tooltip` | `string` | The tip text of this property. |
| `value.data_type` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | The data type of the values. Lookup properties use `DATATYPE_LOOKUP` (one item) or `DATATYPE_MULTI_SELECT_LOOKUP` (several items). |
| `value.content_type` | [`ContentType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ContentType/index.md) | 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). |
| `value.is_based_on_value_list` | `bool` | 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). |
| `value.enable_automatic_permissions` | `bool` | True to allow automatic permissions via this property def. |
| `value.is_conflict_reference` | `bool` | True if this is the conflict property of the object type in `value_list`. |
| `value.disallow_as_grouping_level` | `bool` | True to disallow using this property def as a grouping level in views. |
| `value.value_list` | `int32` | With `is_based_on_value_list`, the ID of the value list or object type whose items are the property's values. |
| `value.value_list_item_filter[]` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | 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. |
| `value.value_list_item_filter[].expression` | [`Expression`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Expression/index.md) | The left side of the condition: what is evaluated for each object, such as a property value, a status value or any field (full-text search). |
| `value.value_list_item_filter[].type` | [`ConditionType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ConditionType/index.md) | The comparison operator. |
| `value.value_list_item_filter[].value` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | The right side of the condition: the value to compare with. Its data type must suit the expression, for example a lookup for a lookup property, Boolean for `STATUS_TYPE_IS_DELETED`. |
| `value.update_type` | [`UpdateType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.UpdateType/index.md) | The update behaviour of the property. Values: `UPDATE_TYPE_NORMAL` (0), `UPDATE_TYPE_SET_BY_SERVER` (1), `UPDATE_TYPE_SET_BY_CLIENT_CODE` (2). |
| `value.automatic_value_type` | [`AutomaticValueType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.AutomaticValueType/index.md) | 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). |
| `value.default_value` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | If set, specifies a fixed default value for this property. |
| `value.default_value.is_null_value` | `bool` | True if the value is empty. `data` is then unset. |
| `value.default_value.type` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | The data type of the value. |
| `value.default_value.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. |
| `value.icon` | [`Bytes`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Bytes/index.md) | If set, contains an icon in .ICO format (contains multiple sizes and color depths). |
| `value.icon.value` | `bytes` | Array of bytes. |
| `value.is_predefined` | `bool` | True if this is a predefined PropertyDef. Predefined PropertyDefs cannot be deleted and modifying them is restricted. |
| `value.allow_for_all_object_types` | `bool` | True if this property definition can be used with all object types. |
| `value.is_owner` | `bool` | True if this is the owner property of the object type in `value_list`. |
| `value.is_default` | `bool` | True if this is the default property of the object type in `value_list` (`ValueList.default_property_def`). |
| `value.owner_property_def_info` | [`OwnerPropertyDef`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OwnerPropertyDef/index.md) | 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. |
| `value.owner_property_def_info.property_def` | `int32` | The ID of the owner property definition, or -106 if the owner property is determined automatically. |
| `value.owner_property_def_info.dependency_relation` | [`DependencyRelation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.DependencyRelation/index.md) | How this property depends on its owner property: `DEPENDENCY_RELATION_FILTER` limits its values to those that belong to the owner property's value, `DEPENDENCY_RELATION_FILL` fills it automatically from the owner property's value. Values: `DEPENDENCY_RELATION_NOTHING` (0), `DEPENDENCY_RELATION_FILL` (1), `DEPENDENCY_RELATION_FILTER` (2). |
| `value.owner_property_def_info.data` | [`DependentPropertyDefUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DependentPropertyDefUnion/index.md) | Details of the `DEPENDENCY_RELATION_FILL` relation. |
| `value.object_type` | `int32` | If `allow_for_all_object_types` is false, the object type whose objects use this property; otherwise ignored. |
| `value.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | If set, specifies the ACL that defines the visibility and editability of this property in objects. |
| `value.acl.checked_out_to_user` | `int32` | Specifies the ID of the user who has extended rights because of the checkout operation performed by her. 0 if such user does not exist. |
| `value.acl.is_fully_authoritative` | `bool` | Specifies whether this access control list is set to ignore the secondary permissions that come from the latest checked in version. |
| `value.acl.custom_component` | [`AccessControlListComponent`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponent/index.md) | Accesses the custom component of this ACL. |
| `value.acl.restrictive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the restrictive automatic components of this ACL. |
| `value.acl.secondary_access_control_list` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) (recursive) | Secondary ACL used for latest version ACL. Not used for access check if null. |
| `value.acl.additive_components[]` | repeated [`AccessControlListComponentMapEntry`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlListComponentMapEntry/index.md) | Accesses the additive automatic components of this ACL. |
| `value.property_def_permissions` | [`PropertyDefPermissionsForClient`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDefPermissionsForClient/index.md) | What the caller may do with values of this property: see them and edit them. Set when the property definition has permissions. |
| `value.property_def_permissions.current_user_can_see` | `bool` | The property def is visible for the current user (provided for symmetry). |
| `value.property_def_permissions.current_user_can_edit` | `bool` | The current user can edit the values. |
| `value.value_list_sorting_type` | [`VLSortingType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.VLSortingType/index.md) | The sorting type of value list items. Values: `VLSORTING_TYPE_BY_DISPLAY_NAME` (0), `VLSORTING_TYPE_BY_EXTERNAL_ID` (1). |
| `value.value_list_sort_ascending` | `bool` | True to sort in ascending order, false to sort in descending order. |
| `value.validation_type` | [`ValidationType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ValidationType/index.md) | How values are validated; `validation_string` holds the rule. Values: `VALIDATION_TYPE_NONE` (0), `VALIDATION_TYPE_REGEX` (1), `VALIDATION_TYPE_CODE` (2). |
| `value.validation_string` | `string` | The validation rule; its meaning depends on `validation_type`. |
| `value.formatting_type` | [`FormattingType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FormattingType/index.md) | How values are formatted; `formatting_string` holds the format. Values: `FORMATTING_TYPE_NONE` (0). |
| `value.formatting_string` | `string` | The format; its meaning depends on `formatting_type`. |
| `value.guid` | `string` | The GUID of the property definition, with braces. |
| `value.options` | [`PROPERTYDEFFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PROPERTYDEFFLAGS/index.md) | Flags such as `can_use_in_search`. See [PROPERTYDEFFLAGS](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PROPERTYDEFFLAGS/index.md). |
| `value.options.all` | `bool` | Specifies all flags set; Including any future flags. |
| `value.options.can_use_in_search` | `bool` | Are objects searchable by this property? |
| `value.options.can_use_in_history_search` | `bool` | Are history versions of objects searchable by this property? |
| `value.options.show_only_filtered_values` | `bool` | Should only the values matching the property filter be shown on the metadata card? |

<a id="related"></a>

## Related methods

- [IRPCValueLists.SearchValueListItemsWithPermissions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCValueLists/SearchValueListItemsWithPermissions/index.md): Searches the items of one value list or object type by item ID, name, owner, parent or deleted state.
