Preserving unedited fields in a bulk-edit action

I have an action that modifies objects (allows for multiple objects at once). Editing all properties is not required, and we’re using this to enable users to bulk-edit any given property.

However, even if the other properties are not edited through this action, they are overwritten in the objects to null . How can we ensure that only properties with non-null values in the form are edited, and the rest remain unchanged?

Eg. The action form has 3 properties (not required). If I fill out the action form with just Property B = somevalue, the other two properties will have their values reset to null for the selected objects.

If you switch to backing your action with a function, you should be able to handle this case. You can check to see if the input is null and if so use the original value or not update the field.

Something like this:

@Edits(obj)
@OntologyEditFunction()
pubic async editObject(objs: <objType>[], field: string): Promise<void> {
  objs.forEach(obj => {
    obj.property = field ?? obj.property
}