# Perspective Binding configuration IF statement not working

**URL:** <https://forum.inductiveautomation.com/t/perspective-binding-configuration-if-statement-not-working/41280>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 7, 2020, 10:08pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-configuration-if-statement-not-working/41280 "2020-12-07T22:08:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanbuckley2698](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@seanbuckley2698](https://forum.inductiveautomation.com/u/seanbuckley2698)\
**Post date:** [December 7, 2020, 10:08pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-configuration-if-statement-not-working/41280/1 "2020-12-07T22:08:06Z")

</div>

Hi, I have 3 user roles( administrator, users, member ), this code is behind the binding of a visible property of a label which says “Users”, “Administrator” or “Member” based on what you are logged in as. I want the label to be invisible if you are not logged in as any of the roles but its not working with what i have at the moment. Any help is welcome, thanks.

```auto
if(({this.props.text} != "Administrator") || ({this.props.text} != "Users") || ({this.props.text} != "Member"), false,true)

```

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [December 7, 2020, 11:53pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-configuration-if-statement-not-working/41280/2 "2020-12-07T23:53:54Z")

</div>

It sounds like you want logical AND instead of logical OR. Replace || with &&.

A little prettier formatting:

```auto
if(
    ({this.props.text} != "Administrator")
        && ({this.props.text} != "Users")
        && ({this.props.text} != "Member"),
    false,
    true
)

```

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [December 8, 2020, 12:07am UTC](https://forum.inductiveautomation.com/t/perspective-binding-configuration-if-statement-not-working/41280/3 "2020-12-08T00:07:22Z")

</div>

> [@seanbuckley2698](#):
>
> if(({this.props.text} != "Administrator") || ({this.props.text} != "Users") || ({this.props.text} != "Member"), false,true)

I think @zacht is correct, and this would be more clear if you reversed your logic:

```auto
if(({this.props.text} = "Administrator") || ({this.props.text} = "Users") || ({this.props.text} = "Member"), true,false)

```

---

<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:** [December 8, 2020, 12:14am UTC](https://forum.inductiveautomation.com/t/perspective-binding-configuration-if-statement-not-working/41280/4 "2020-12-08T00:14:59Z")

</div>

You can also ditch the pointless `if` call, since the `=` operator already returns a boolean result:  
`{this.props.text} = "Administrator" || {this.props.text} = "Users" || {this.props.text} = "Member"`

---

<div class="post-metadata">

**Author:** ![seanbuckley2698](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@seanbuckley2698](https://forum.inductiveautomation.com/u/seanbuckley2698)\
**Post date:** [December 8, 2020, 11:42am UTC](https://forum.inductiveautomation.com/t/perspective-binding-configuration-if-statement-not-working/41280/5 "2020-12-08T11:42:09Z")

</div>

Hi Zacht, I ran it there and works perfectly, thanks very much.
