Pass null value to a custom property

Hello,

Is it possible de assign a null value to a custom property of a form ?

Well, you can pass None to a custom property ( instead of NULL, but they are the same).

From “Stack Overflow”:

In Python, the ‘null’ object is the singleton None .

The best way to check things for “Noneness” is to use the identity operator, is :

if foo is None:
    ...
1 Like

Hi,
Your answer is How to test. But my question is How to attribute a null value to a custom properties. We try null, Null, none, None and we Always have an error.

Use NULL as an expression.

1 Like

Well, I tried to pass None to a String Custom Property ( via scripting ) and after that assignment, the custom property had a None value ( which is the same of NULL )
Here it is the code I used:

event.source.parent.getComponent('PB Device').Null = None
print event.source.parent.getComponent('PB Device').Null
print type(event.source.parent.getComponent('PB Device').Null)

And that’s the output:

None
<type 'NoneType'>

Perhaps, post your code so we can try to understand your final goal :muscle:

This may be the crux of your problem. Custom properties can hold a null (jython None), but input fields generally cannot hold nulls in their text or numeric value properties.

Thanks to all,
I found my problem.
I try to do it with the “navigation tab” and the code auto-generated convert None to ‘None’.

When i do by the code with the Syntax None (without the quote) it’s working.

working