Fetching property that has empty value and updating them from the script

Category to use for discussions about the Lab Notebook functionality of openBIS.

Hi,
I am working in openbis dynamic property plugin.

Currently I have a collection > Sample > and object with a property that is empty(type integer, but has no value).
I am fetching all the samples with , samples = entity.entityPE().getSamples()

now I want to see all the properties in that sample and update some of them.
some properties has pre defined value. and some properties are empty. (has no value but has already predefined property type)

what I realized:
I can fetch properties only with pre defined values with: sample.getProperties(). here I am able to update values from script with setValue(). the properties without a value is not shown here.

for all the properties, with and without value can be fetched with
sample.getSampleType().getSampleTypePropertyTypes()

but here, I could not find any option to update or set the property value.

Can anyone please give me some hints on this topic please.

TIA :smiley:

Dear @asarker ,
While this might be doable with the Dynamic Plugin methods, it might be easier to achieve what you want to do with a V3 API interceptor plugin.
Another approach would be to import the V3 API in your dynamic script and use it to perform more advanced operations, however I am not sure how safe it is

HI,

with V3 API, it is possible to login as a system and update a value, but by doing so, the modifier gets updated to the system as well. Is there a way to work around this problem so that, the modifier stays as the original user?

is there any way to declare a property with a pre defined value? other then keeping it empty of null when creating the object?

TIA

I don’t think this is possible, and that by design: the user running the modification is recorded for compliance reasons (e.g if you want to audit your data when you suspect manipulation).

You could create a template of the object with predefined values. This template can be loaded and used to create new objects later on.