Skip to main content
Answer

Non-writable error while populating data into new version of a view

  • April 16, 2025
  • 4 replies
  • 53 views

Ayush Daruka
Seasoned

Hi,

I have a view called "Entity" in an existing model with mandatory properties "name", "description" and "isVirtual".
Now, I have a new version of "Entity" in which I have decided to implement CogniteDescribable from CDM for name and description, where these fields are not mandatory.
When I try to ingest data into the new version of this view, it gives me a non-writable error since the mandatory properties that I had created for the older version is not getting populated.
Is there any way to overcome this?
Can I map the mandatory container to the container used in CogniteDescribable, so that when I ingest data in the new version, it automatically ingests the mandatory container as well?
If yes, can you please share a YAML example of the same to be deployed through toolkit?

Please note that both the mandatory and non-mandatory containers have the same name "name".

Best answer by Arild Eide

Hi ​@Ayush Daruka 

Nullability/requiredness of a property is enforced on the container level. (API documentation). So when mapping container properties to views the requiredness is enforced regardless of view and view version. The second version of the Entity view can map properties from both the Entity container and the CogniteDecscribable container.

It is, however, not possible to map more than one container property to the same view property. Therefore, to write to container property Entity.name and CogniteDescribable.name you will have to map these property to two different view property and write the same value to both.

 

Hope this helps. 

 

Arild Eide

 

 

4 replies

Ayush Daruka
Seasoned
  • Author
  • Seasoned
  • April 16, 2025

@Snehal-Jagtap 


Ayush Daruka
Seasoned
  • Author
  • Seasoned
  • April 16, 2025

@HanishSharma 


Arild  Eide
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • Answer
  • April 17, 2025

Hi ​@Ayush Daruka 

Nullability/requiredness of a property is enforced on the container level. (API documentation). So when mapping container properties to views the requiredness is enforced regardless of view and view version. The second version of the Entity view can map properties from both the Entity container and the CogniteDecscribable container.

It is, however, not possible to map more than one container property to the same view property. Therefore, to write to container property Entity.name and CogniteDescribable.name you will have to map these property to two different view property and write the same value to both.

 

Hope this helps. 

 

Arild Eide

 

 


Ayush Daruka
Seasoned
  • Author
  • Seasoned
  • April 18, 2025

@Arild Eide Thanks for the clarification. Most probably, I misunderstood what the support wanted me to do.