# Conditionally visible properties in perspective module

**URL:** <https://forum.inductiveautomation.com/t/conditionally-visible-properties-in-perspective-module/38740>\
**Category:** Module Development\
**Created:** [September 16, 2020, 11:30am UTC](https://forum.inductiveautomation.com/t/conditionally-visible-properties-in-perspective-module/38740 "2020-09-16T11:30:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewis.storey](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lewis.storey/32/15026_2.png) [@lewis.storey](https://forum.inductiveautomation.com/u/lewis.storey)\
**Post date:** [September 16, 2020, 11:30am UTC](https://forum.inductiveautomation.com/t/conditionally-visible-properties-in-perspective-module/38740/1 "2020-09-16T11:30:24Z")

</div>

I am building a perspective module and I have a property I need to make visible only when a property elsewhere in the tree is true but I can’t figure out how to reference it. As an example, I have this tree:

```auto
object1
    prop1
object2
    prop2

```

So I need prop2 to only be visible in the designer when prop1 is true. I’ve tried “…object1.prop1” and “/object1.prop1” as references but neither work. Does this only work with properties on the same level or is there a way to correctly set this reference?

---

<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:** [September 16, 2020, 3:35pm UTC](https://forum.inductiveautomation.com/t/conditionally-visible-properties-in-perspective-module/38740/2 "2020-09-16T15:35:40Z")

</div>

I don’t think the `visibleWhen` validator supports walking back up indirect references, from a scan of the code. It might work on `object2.prop1`, like this, but I’m not sure if it will walk down like that. In our codebase, the only examples I could find are direct sibling references. It looks like theoretically something like `property: object2, equals: {"prop1": true}` would be the way to do this, but I’m pretty sure there’s a bug in our code.

```json
{
  "object1": {
    "type": "object",
    "properties": {
      "prop1": {
        "type": "boolean"
      }
    }
  },
  "object2": {
    "type": "object",
    "properties": {
      "prop2": {}
    },
    "visibleWhen": {
      "property": "object1.prop1",
      "equals": true
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![lewis.storey](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lewis.storey/32/15026_2.png) [@lewis.storey](https://forum.inductiveautomation.com/u/lewis.storey)\
**Post date:** [September 17, 2020, 1:56pm UTC](https://forum.inductiveautomation.com/t/conditionally-visible-properties-in-perspective-module/38740/3 "2020-09-17T13:56:54Z")

</div>

I figured that might be the case given all I’d seen were siblings affecting each other. Thank you for taking the time to look. If it means re-arranging the tree that’s no huge deal

---

<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:** [September 17, 2020, 3:23pm UTC](https://forum.inductiveautomation.com/t/conditionally-visible-properties-in-perspective-module/38740/4 "2020-09-17T15:23:53Z")

</div>

For what it’s worth, I filed a ticket to check on supporting objects as the `equals` reference. I can’t guarantee it’ll get accepted, but it seems reasonable.
