# IRPCPropertyDefsAdmin.UpdatePropertyDef

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Property definition and class administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/index.md)

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

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Saves a changed property definition.

- **Service:** [Property definition and class administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/index.md) `MFiles.IRPCPropertyDefsAdmin`
- **gRPC method:** `/MFiles.IRPCPropertyDefsAdmin/UpdatePropertyDef`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/update-property-def`
- **Request:** [`UpdatePropertyDefRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/UpdatePropertyDef/index.md#request)
- **Response:** [`UpdatePropertyDefResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/UpdatePropertyDef/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

- Requires `change_metadata_structure` and `license_allows_modifications`, plus the code rights
  described in [AddPropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/AddPropertyDef/index.md) when VBScript
  code is set or changed.
- `data_type`, `is_based_on_value_list`, `value_list` and `update_type` cannot change: send them
  exactly as stored.
- Applying changed automatic permissions to existing objects runs as background tasks, returned
  in `async_task_ids`; follow them with
  [GetAsyncTask](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetAsyncTask/index.md).
- Increments `property_defs_version` and the metadata structure version.

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

## Request: UpdatePropertyDefRequest

> 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 |
|---|---|---|
| `propdefadmin` | [`PropertyDefAdmin`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDefAdmin/index.md) | The complete new definition; `property_def.id` identifies it. Start from [GetPropertyDefAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/GetPropertyDefAdmin/index.md). |
| `propdefadmin.property_def` | [`PropertyDef`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDef/index.md) | Basic data. |
| `propdefadmin.property_def.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. |
| `propdefadmin.property_def.name` | `string` | The name of the property. |
| `propdefadmin.property_def.tooltip` | `string` | The tip text of this property. |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.enable_automatic_permissions` | `bool` | True to allow automatic permissions via this property def. |
| `propdefadmin.property_def.is_conflict_reference` | `bool` | True if this is the conflict property of the object type in `value_list`. |
| `propdefadmin.property_def.disallow_as_grouping_level` | `bool` | True to disallow using this property def as a grouping level in views. |
| `propdefadmin.property_def.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. |
| `propdefadmin.property_def.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. |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.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. |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.is_predefined` | `bool` | True if this is a predefined PropertyDef. Predefined PropertyDefs cannot be deleted and modifying them is restricted. |
| `propdefadmin.property_def.allow_for_all_object_types` | `bool` | True if this property definition can be used with all object types. |
| `propdefadmin.property_def.is_owner` | `bool` | True if this is the owner property of the object type in `value_list`. |
| `propdefadmin.property_def.is_default` | `bool` | True if this is the default property of the object type in `value_list` (`ValueList.default_property_def`). |
| `propdefadmin.property_def.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. |
| `propdefadmin.property_def.object_type` | `int32` | If `allow_for_all_object_types` is false, the object type whose objects use this property; otherwise ignored. |
| `propdefadmin.property_def.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. |
| `propdefadmin.property_def.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. |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.value_list_sort_ascending` | `bool` | True to sort in ascending order, false to sort in descending order. |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.validation_string` | `string` | The validation rule; its meaning depends on `validation_type`. |
| `propdefadmin.property_def.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). |
| `propdefadmin.property_def.formatting_string` | `string` | The format; its meaning depends on `formatting_type`. |
| `propdefadmin.property_def.guid` | `string` | The GUID of the property definition, with braces. |
| `propdefadmin.property_def.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). |
| `propdefadmin.automatic_value` | [`AutomaticValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AutomaticValue/index.md) | The definitions for automatic value generation. |
| `propdefadmin.automatic_value.automatic_numbering_increment` | `int32` | Simple automatic numbering: Increment. |
| `propdefadmin.automatic_value.automatic_numbering_code` | `string` | Automatic numbering with VBScript: VBScript code. |
| `propdefadmin.automatic_value.calculated_value_template` | `string` | Simple calculated value: Expression. |
| `propdefadmin.automatic_value.calculated_value_code` | `string` | Calculated value with VBScript: VBScript code. |
| `propdefadmin.automatic_value.calculation_order` | `int32` | A number that specified calculation order. Properties are calculated from smallest to largest calculation order number. |
| `propdefadmin.validation` | [`Validation`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Validation/index.md) | The definitions for property value validation. |
| `propdefadmin.validation.regular_expression` | `string` | A regular expression for the validation. |
| `propdefadmin.validation.code` | `string` | VBScript used in the validation. |
| `propdefadmin.aliases` | `string` | Semicolon-separated list of semantic aliases for metadata mapping. |
| `propdefadmin.tags` | [`NamedValueNamespaces`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedValueNamespaces/index.md) | Names value namespaces related to the property definition. |
| `propdefadmin.tags.value[]` | repeated [`NamedValueNamespace`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedValueNamespace/index.md) | An array of the NamedValueNAmespace structures. |
| `reset_last_used_value` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | For an automatic numbering property, the number to continue from. Leave unset to keep the current one. |
| `reset_last_used_value.is_null_value` | `bool` | True if the value is empty. `data` is then unset. |
| `reset_last_used_value.type` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | The data type of the value. |
| `reset_last_used_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. |
| `reset_last_used_value.data.text` | `string` (oneof data) | The value of `DATATYPE_TEXT`. |
| `reset_last_used_value.data.integer` | `int32` (oneof data) | The value of `DATATYPE_INTEGER`. |
| `reset_last_used_value.data.real_number` | `double` (oneof data) | The value of `DATATYPE_REAL_NUMBER`. |
| `reset_last_used_value.data.decimal_number` | `string` (oneof data) | Fixed precision number. |
| `reset_last_used_value.data.date` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | The value of `DATATYPE_DATE`: midnight UTC of the date. |
| `reset_last_used_value.data.time` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | Time. |
| `reset_last_used_value.data.timestamp` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | The value of `DATATYPE_TIMESTAMP`, in UTC. |
| `reset_last_used_value.data.boolean` | `bool` (oneof data) | The value of `DATATYPE_BOOLEAN`. |
| `reset_last_used_value.data.lookup` | [`Lookup`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Lookup/index.md) (oneof data) | The value of `DATATYPE_LOOKUP`: one value list item or object. |
| `reset_last_used_value.data.multi_select_lookup` | [`MultiSelectLookup`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.MultiSelectLookup/index.md) (oneof data) | The value of `DATATYPE_MULTI_SELECT_LOOKUP`: any number of value list items or objects. |
| `reset_last_used_value.data.integer64` | `int64` (oneof data) | Integer (8 bytes). |
| `reset_last_used_value.data.filetime` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) (oneof data) | FILETIME (64-bit integer). |
| `reset_last_used_value.data.multi_line_text` | `string` (oneof data) | The value of `DATATYPE_MULTI_LINE_TEXT`. |
| `reset_last_used_value.data.acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) (oneof data) | Access Control List. |
| `automatic_permissions_forced_active` | `bool` | Used only when the change turns on automatic permissions: true to make them active on existing objects, false to add them inactive. |

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

## Response: UpdatePropertyDefResponse

> 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 |
|---|---|---|
| `async_task_ids[]` | repeated [`AsyncTaskID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AsyncTaskID/index.md) | Asynchronous task identifiers, if any, related to the change. |
| `async_task_ids[].id` | `int64` | Task ID. |
| `async_task_ids[].type` | `string` | Task type name. |
| `async_task_ids[].definition` | `string` | The display string of the task definition. |

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

## Related methods

- [AddPropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/AddPropertyDef/index.md): Creates a property definition.
- [IRPCBackgroundOperationsAdmin.GetAsyncTask](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCBackgroundOperationsAdmin/GetAsyncTask/index.md): Gets one asynchronous task by ID.
