# Visibility based on Null Tag value

**URL:** <https://forum.inductiveautomation.com/t/visibility-based-on-null-tag-value/20278>\
**Category:** General Discussion\
**Created:** [October 19, 2018, 7:59pm UTC](https://forum.inductiveautomation.com/t/visibility-based-on-null-tag-value/20278 "2018-10-19T19:59:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_hanson](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@p\_hanson](https://forum.inductiveautomation.com/u/p_hanson)\
**Post date:** [October 19, 2018, 7:59pm UTC](https://forum.inductiveautomation.com/t/visibility-based-on-null-tag-value/20278/1 "2018-10-19T19:59:51Z")

</div>

I’m trying to make a button visible only when a text field is not null. I’ve tried the following in the Expression binding of the Visible property of the button:

if({tag}=null, false, true)  
if({property}=null, false, true)

if(isNull({tag}), false, true)  
if(isNull({property}), false, true)

This is not working. I want the button only visible when an operator enters their name.  
Previously I tried {tag}!= “”, but putting a space into the text field will make the button visible.

Thank you in advance for your assistance.

---

<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:** [October 19, 2018, 8:09pm UTC](https://forum.inductiveautomation.com/t/visibility-based-on-null-tag-value/20278/2 "2018-10-19T20:09:45Z")

</div>

Text fields are basically never null, IIRC. Test for a zero-length string, instead.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 19, 2018, 8:13pm UTC](https://forum.inductiveautomation.com/t/visibility-based-on-null-tag-value/20278/3 "2018-10-19T20:13:23Z")

</div>

`len(trim({Root Container.Text Field.text}))`

Trim the string to remove surrounding whitespace (including if just spaces are entered) and then if the length is 1 or more, it will be evaluated as true. No if statement required.
