How do I bulk delete ontology objects?

In ontology explorer I can use the delete action to delete one at a time, but it won’t work when selecting more than one ontology object. I assume this means I need a new action to delete many at time? Not sure how to do this…

Deleting objects in bulk is not directly configurable from the Ontology Manager to add a layer of protection here.

To set this up manually, create the following Typescript function:

@OntologyEditFunction()
public deleteMultipleObjects(objects: ObjectSet<DemoObjectType>): void {
   objects.all().forEach(o => {
      o.delete()
   })
}

Then make sure you wrap this function in an action and you can pass an object set through to be deleted in bulk!

An action can be applied to multiple objects by toggling “Allow multiple values” in the object reference parameter. Then in Workshop, an Object Table can use “enable multi-select”, which creates checkboxes for each row and a “Select all” checkbox in the table headers row. These selected objects can then be collectively passed to the action (example below).

image

I don’t know if there is a limit to the number of objects that can be deleted by an action.

More info: palantir foundry - How can I apply an Action to more than one object in a Workshop table? - Stack Overflow

Update: This solved the issue – An action can be applied to multiple objects by toggling “Allow multiple values” in the object reference parameter. Then in Workshop, an Object Table can use “enable multi-select”, which creates checkboxes for each row and a “Select all” checkbox in the table headers row. These selected objects can then be collectively passed to the action.

https://community.palantir.com/t/how-to-bulk-apply-an-action-function-to-all-existing-objects/963/2

1 Like