Re-create a delted object

Hello,

How to re-create an object that has been deleted and get back all its properties (Object of an Ontology Object Type V2) ?

Context:

User has used a delete action on 200 object and we realized now that some Object shouldn’t be deleted. Object input row still exist in the backing dataset. (It doesn’t exist in the Materialization dataset, normal). If we use a “create action” and input the exactly same object key, the object is create but all other fields are empty.

For futur, we can adapt the architecture by replacing “delete action” by a “modify action” that edit a boolean “is delted” property.

But for how to recover this 200 delted object without reset all the edit made on the Object Type ?

Note:

Architecture was build based on Phonograph knowledges, where we observed that create an object with the same primary key than a deleted object restore all properties. It seem that Ontology V2 behaviour is different.

Hi ,

Does the Object type back a materialization dataset? If so, you can open this dataset in Contour and go through the history of the different commits (if your enrolment is storing these) and find the data for the deleted objects. Export this to recreate them.

In the future, you could also set up logging for an Action that deletes these objects. This allows you to inspect what happened and you can easily code a function that can recreate deleted objects, as long as all properties are stored there.

Cheers!

Hi, @jakehop Thank you for you answer.

My previous description failed to highlight a crucial requirement: the object’s properties must remain dynamic and driven by the backing dataset. Manually assigning properties during an action-based recreation results in static values, breaking the link with the data source.

In that case, if you have the materialization you can create a new dataset with the deleted object and union those in via a single operation.

Moving forward, your soft-delete approach will probably be the easiest given your current setup.