# Access properties of of component from another view?

**URL:** <https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 14, 2022, 7:39pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492 "2022-11-14T19:39:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil\_Nagpal](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Sahil\_Nagpal](https://forum.inductiveautomation.com/u/Sahil_Nagpal)\
**Post date:** [November 14, 2022, 7:39pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/1 "2022-11-14T19:39:19Z")

</div>

Hi,  
I am trying to link a property which is present in my header view, to one of my components in another view. Is this possible to do? When I try and browse the available properties, I am only seeing properties pertaining to all components that are within my current view, and not the header view.

Any help would be appreciated!

Thanks.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 14, 2022, 7:44pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/2 "2022-11-14T19:44:47Z")

</div>

If you want to share data across views, you really need to use session properties. I don't believe that views know about each other at all.

---

<div class="post-metadata">

**Author:** ![Sahil\_Nagpal](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Sahil\_Nagpal](https://forum.inductiveautomation.com/u/Sahil_Nagpal)\
**Post date:** [November 14, 2022, 7:48pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/3 "2022-11-14T19:48:24Z")

</div>

Hi,  
So how can I get the path of the property to bind to my session prop? For example, if I want to create a custom session prop called "label\_value", what would the path be if I am trying to bind the value located in "./Header.header.root.label.value"?

---

<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:** [November 14, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/4 "2022-11-14T19:57:11Z")

</div>

Views/Components only have insight into the properties of the following areas:

- Components within the same View (NOT child views)
- Session
- Page

If you need access to a property in a _different_ view, then by definition that property should be scoped differently.

While examining the Session Properties in the Designer, scroll down to the `Custom` area at the bottom and add your new property: `label_value`. Don't forget to add a default value. I also recommend a more concise name as this label apparently means something very specific to the session and you won't want to have questions about it later.

When binding, you'll bind against `this.session.custom.label_value`.

---

<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:** [November 14, 2022, 8:04pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/5 "2022-11-14T20:04:08Z")

</div>

And you don't bind the session prop to the view's label. You bind from the label to the session prop, bidirectionally, if necessary. Do this in both views.

---

<div class="post-metadata">

**Author:** ![Sahil\_Nagpal](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Sahil\_Nagpal](https://forum.inductiveautomation.com/u/Sahil_Nagpal)\
**Post date:** [November 14, 2022, 8:15pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/6 "2022-11-14T20:15:17Z")

</div>

Hi,  
I think I understand but I am not sure how to write the value from my label to the session prop.

So my label inside my header has a value: "Hello".

How do I go about binding this to my session prop? Once I bind to "this.session.custom.my\_label" the label inside my header turns to null.

I think I am missing something simple.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 14, 2022, 8:25pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/7 "2022-11-14T20:25:04Z")

</div>

> [@Sahil\_Nagpal](#):
>
> Once I bind to "this.session.custom.my\_label" the label inside my header turns to null.

Did you make the binding **bidirectional**?  
If you don't then the label just displays the session property.  
If you do then setting the label will update the session property.

---

<div class="post-metadata">

**Author:** ![Sahil\_Nagpal](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Sahil\_Nagpal](https://forum.inductiveautomation.com/u/Sahil_Nagpal)\
**Post date:** [November 14, 2022, 8:29pm UTC](https://forum.inductiveautomation.com/t/access-properties-of-of-component-from-another-view/66492/8 "2022-11-14T20:29:34Z")

</div>

Thanks guys, I got it. I just need to set the binding to bi-directional, **and also** have a default value in my session props.

Much appreciate everyone's support!
