# Pass null value to a custom property

**URL:** <https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [April 8, 2019, 1:57pm UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918 "2019-04-08T13:57:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![n.monnier](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n.monnier](https://forum.inductiveautomation.com/u/n.monnier)\
**Post date:** [April 8, 2019, 1:57pm UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918/1 "2019-04-08T13:57:24Z")

</div>

Hello,

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

---

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [April 9, 2019, 9:03am UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918/2 "2019-04-09T09:03:02Z")

</div>

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` :

```auto
if foo is None:
    ...

```

---

<div class="post-metadata">

**Author:** ![n.monnier](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n.monnier](https://forum.inductiveautomation.com/u/n.monnier)\
**Post date:** [April 9, 2019, 4:57pm UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918/3 "2019-04-09T16:57:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 9, 2019, 5:02pm UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918/4 "2019-04-09T17:02:26Z")

</div>

Use NULL as an expression.

---

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [April 10, 2019, 6:15am UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918/5 "2019-04-10T06:15:01Z")

</div>

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:

```auto
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:

```auto
None
<type 'NoneType'>

```

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 10, 2019, 11:45am UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918/6 "2019-04-10T11:45:42Z")

</div>

> [@n.monnier](#):
>
> of a form

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.

---

<div class="post-metadata">

**Author:** ![n.monnier](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@n.monnier](https://forum.inductiveautomation.com/u/n.monnier)\
**Post date:** [April 10, 2019, 7:14pm UTC](https://forum.inductiveautomation.com/t/pass-null-value-to-a-custom-property/23918/7 "2019-04-10T19:14:19Z")

</div>

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’.

 ![notworking](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6c35ea0de2a1fe377f1dddab4b543ca9b2d8e523.png)

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

![working](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/faca4af022a4d73bb8f5a00a8161eea709d1a578.png)
