# Text field component text field set to 'Null'

**URL:** <https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264>\
**Category:** Ignition\
**Tags:** ignition83, perspective\
**Created:** [November 19, 2025, 1:04am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264 "2025-11-19T01:04:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![james.phiri](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@james.phiri](https://forum.inductiveautomation.com/u/james.phiri)\
**Post date:** [November 19, 2025, 1:04am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264/1 "2025-11-19T01:04:17Z")

</div>

From my understanding setting the ‘text’ property of a text field component to ‘None’ or a blank string ‘‘ should result in the text field displaying the placeholder property text.

self.props.text = None

This code results in the text value being set to the value “Null” as seen below. I have also included another instance of the text field below it displaying how the placeholder text should be appearing.

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

Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 19, 2025, 2:54am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264/2 "2025-11-19T02:54:44Z")

</div>

I’d say that’s how it should work for `null`s as well, but currently “empty” (as mentioned by the user manual) means an empty string

---

<div class="post-metadata">

**Author:** ![james.phiri](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@james.phiri](https://forum.inductiveautomation.com/u/james.phiri)\
**Post date:** [November 19, 2025, 3:21am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264/3 "2025-11-19T03:21:21Z")

</div>

I get the same result if I use the following  
self.props.text = ‘‘

or

self.props.text = ““  
Setting it to None or an empty string both result in a ‘Null’ text value rather than an empty text box

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 19, 2025, 3:31am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264/4 "2025-11-19T03:31:50Z")

</div>

can you show a screenshot of the component text prop?

this works for me (i.e. `self.props.text = ''`):

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/6/1637f62175d44307416012fe26fd5dc266fab36d.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/26ac3f79062780b17aba41ce076b6935b3bb2914.png)

---

<div class="post-metadata">

**Author:** ![james.phiri](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@james.phiri](https://forum.inductiveautomation.com/u/james.phiri)\
**Post date:** [November 19, 2025, 3:36am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264/5 "2025-11-19T03:36:00Z")

</div>

This is in a message handler that is triggered upon saving the input value.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c153c9aae1c4c4fcc3b1d678a4664cd67efcdf86.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0b0b84076d0bccfb39ddba022ef67e7b9aeb8e0b.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 19, 2025, 3:39am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264/6 "2025-11-19T03:39:41Z")

</div>

Copy this component JSON into your View and see if it works for you. it’s just the JSON for a simple text field component. Toggle the “key” bool and will send a p.msg “bob” with a handler that sets the text to an empty string and then the placeholder appears

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/9/197967f78ee775a0a391d2bfe075b110d97ae187.png)

```python
[
  {
    "type": "ia.input.text-field",
    "version": 0,
    "props": {
      "text": "You'll never catch me!",
      "placeholder": "Peek-a-boo!"
    },
    "meta": {
      "name": "TextField"
    },
    "position": {
      "basis": "32px"
    },
    "custom": {
      "key": false
    },
    "propConfig": {
      "custom.key": {
        "onChange": {
          "script": "\tsystem.perspective.sendMessage('bob')",
          "enabled": null
        }
      }
    },
    "scripts": {
      "customMethods": [],
      "messageHandlers": [
        {
          "messageType": "bob",
          "script": "\tself.props.text = ''",
          "sessionScope": false,
          "pageScope": true,
          "viewScope": false
        }
      ],
      "extensionFunctions": null
    }
  }
]

```

Edit: what component is that message handler code defined on?

---

<div class="post-metadata">

**Author:** ![james.phiri](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@james.phiri](https://forum.inductiveautomation.com/u/james.phiri)\
**Post date:** [November 19, 2025, 3:42am UTC](https://forum.inductiveautomation.com/t/text-field-component-text-field-set-to-null/112264/7 "2025-11-19T03:42:28Z")

</div>

Thanks for your help, I have resolved it. There was a change script I wasn’t aware of that was setting the value to ‘None’ in the case that it was set to an empty string which was causing the issue.  
Setting self.props.text = ‘‘ will result in an empty box, self.props.text = None will result in the text ‘Null’  
Thanks again
