UIX V2 Update Property Value

Hey everyone,

I'm currently trying to modify an M-Files object property through the UIX V2 framework API using SetPropertiesMultiple, but I can't get it to work.

Here's my current implementation:

```typescript
const propertyValue = buildPropertyValue(propertyDef, value, datatype);

const payload = {
obj_ver: {
obj_id: {
type: objType,
item_id: { internal_id: objId },
},
version: { type: 1 }, // OBJ_VER_VERSION_TYPE_LATEST
},
allow_modifying_checked_in_object: allowModifyingCheckedIn,
fail_if_not_latest_checked_in_version: failIfNotLatest,
object_version_guid: '',
set_properties: [propertyValue],
is_full_set: isFullSet,
remove_properties: [],
options: {
all: false,
require_read_access_after_operation: false,
require_edit_access_after_operation: false,
disallow_name_change: false,
require_change_permissions_access_after_operation: false,
require_full_access_after_operation: false,
change_acl_in_all_versions: false,
verify_check_in_wopi_locked_document: false,
},
acl_enforcing_mode: 0,
};

try {
await (shellUI.Vault.ObjectOperations.SetPropertiesMultiple as (req: any) => Promise<any>)({
properties: [payload],
});
} catch (error) {
throw new Error(`Failed to update property ${propertyDef} on object ${objId}: ${(error as Error).message}`);
}
```

Has anyone managed to update object properties via the UIX V2 API? Any idea what I might be doing wrong with the payload structure or the SetPropertiesMultiple call?

Thanks in advance! Pray

  • Hey everyone,

    Following my previous post about modifying an M-Files object property via the UIX V2 framework API, I found the solution and wanted to share it!

    White check mark The key insight: when searching for an object, store the objVer returned by the search result, and reuse that exact same objVer when calling SetPropertiesMultiple. Don't rebuild it manually — grab it directly from the search response and pass it as-is into your payload.

    Here's the working implementation:

    ```typescript
    const datatype = await getDatatype(propertyDef);
    const propertyValue = buildPropertyValue(propertyDef, value, datatype);

    const payload = {
     obj_ver: objVer, // Arrow left️ reuse the objVer stored from the search result
    allow_modifying_checked_in_object: allowModifyingCheckedIn,
    fail_if_not_latest_checked_in_version: failIfNotLatest,
    object_version_guid: '',
    set_properties: [propertyValue],
    is_full_set: isFullSet,
    remove_properties: [],
    options: {
    all: false,
    require_read_access_after_operation: false,
    require_edit_access_after_operation: false,
    disallow_name_change: false,
    require_change_permissions_access_after_operation: false,
    require_full_access_after_operation: false,
    change_acl_in_all_versions: false,
    verify_check_in_wopi_locked_document: false,
    },
    acl_enforcing_mode: 0,
    };
    ```

    The mistake I was making before was reconstructing the objVer manually from objId and objType, which caused a mismatch and made the update fail silently. Using the objVer directly from the search response fixed it.

    Hope this saves someone else some time!

    Feel free to reach out if you have any questions Pray