# Append custom fragment to Onnx Managed Object

**URL:** <https://community.cumulocity.com/t/append-custom-fragment-to-onnx-managed-object/333>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [March 8, 2023, 1:11pm UTC](https://community.cumulocity.com/t/append-custom-fragment-to-onnx-managed-object/333 "2023-03-08T13:11:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Waldek\_Bus](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/waldek_bus/32/9234_2.png) [@Waldek\_Bus](https://community.cumulocity.com/u/Waldek_Bus)\
**Post date:** [March 8, 2023, 1:11pm UTC](https://community.cumulocity.com/t/append-custom-fragment-to-onnx-managed-object/333/1 "2023-03-08T13:11:11Z")

</div>

#### What product/components do you use and which version/fix level are you on?

Cumulocity / Machine Learning / Zementis **1014.0.213**

#### Is your question related to the free trial, or to a production (customer) instance?

Production

#### What are you trying to achieve? Please describe it in detail.

We are building a service that uploads an ONNX model to Zementis and we need to add some meta data / custom fragments to the Managed Object representing the uploaded model

```auto
managedObjectRepresentation.setProperty("artifact_meta", artifactDto);
    managedObjectRepresentation.setLastUpdatedDateTime(null);
    ManagedObjectRepresentation updatedManagedObject = inventoryApi.update(managedObjectRepresentation);

```

#### Do you get any error messages? Please provide a **full error** message screenshot and log file.

Http status code: 422  
{error=“inventory/Invalid Data”,message=“Cannot update managed object. : Cannot change binary metadata through inventory api.”,info=“URL”,details=“null”}

#### Have you installed all the latest fixes for the products and systems you are using?

N/A

---

<div class="post-metadata">

**Author:** ![Melanie\_Monnereau](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@Melanie\_Monnereau](https://community.cumulocity.com/u/Melanie_Monnereau)\
**Post date:** [March 8, 2023, 1:35pm UTC](https://community.cumulocity.com/t/append-custom-fragment-to-onnx-managed-object/333/2 "2023-03-08T13:35:42Z")

</div>

Hi

The lastUpdated field cannot be updated.  
Also it is better to create a new object so the c8y API is not going to update ALL properties but only the ones which have changed

```auto
ManagedObjectRepresentation deviceCopy = new ManagedObjectRepresentation();
deviceCopy.setId(yourMo.getId());
deviceCopy.setProperty("artifact_meta", artifactDto);
this.inventoryApi.update(deviceCopy);

```

Have a try and see if you still have an issue.

---

<div class="post-metadata">

**Author:** ![Waldek\_Bus](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/waldek_bus/32/9234_2.png) [@Waldek\_Bus](https://community.cumulocity.com/u/Waldek_Bus)\
**Post date:** [March 8, 2023, 1:47pm UTC](https://community.cumulocity.com/t/append-custom-fragment-to-onnx-managed-object/333/3 "2023-03-08T13:47:10Z")

</div>

Thank you Melanie, you are a star 🙂 Works like a charm. I have been struggling with this for hours.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [September 4, 2023, 1:47pm UTC](https://community.cumulocity.com/t/append-custom-fragment-to-onnx-managed-object/333/4 "2023-09-04T13:47:23Z")

</div>

Closed on September 4, 2023, 1:47pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
