# Expression binding, dynamic path to a property?

**URL:** <https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 17, 2023, 4:48pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010 "2023-08-17T16:48:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 4:48pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/1 "2023-08-17T16:48:14Z")

</div>

Hi,

In Perspective, is there a way in an Expression binding to have a dynamic path to a property of a component on the view ?  
Here's the structure that I have:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/ee373a257817f71e1e9cdd16bebd54d6db0a5765.png)  
I want to apply a style to the numeric field "limit" depending on the value of the numeric field "entry". Here's my code for now:

```auto
if({this.props.value} != None && {../Conductivity_entry.props.value} != None && {this.props.value} < {../Conductivity_entry.props.value}, "LimitsControl/LimitResponsible", "LimitsControl/NormalLimit")

```

What I want is to replace "{../Conductivity\_entry.props.value}" by a dynamic path with the name of the container. I tried something like "{../}+{parent.meta.name}+{\_entry.props.value}" but it's not working, and I don't find a solution.  
Is that possible ?  
Thanks

---

<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:** [August 17, 2023, 5:01pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/2 "2023-08-17T17:01:27Z")

</div>

Have you tried `property()` ?

[https://docs.inductiveautomation.com/display/DOC81/property](https://docs.inductiveautomation.com/display/DOC81/property)

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 17, 2023, 5:05pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/3 "2023-08-17T17:05:03Z")

</div>

In case you ever need to do something in a script, this topic covers that,

> [@Indirect property reference](https://forum.inductiveautomation.com/t/indirect-property-reference/33646):
>
> Is there a way to do an indirect property using a nested property within another property path in an expression? This would be for read-only use and is in Perspective. I’m using the historical playback exchange project and need to bind what would normally be indirect tags to the properties of the playback controller.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 5:26pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/4 "2023-08-17T17:26:29Z")

</div>

Thanks that should work, but I'm not able to write the right path, I tried  
property("../" + {parent.meta.name} + "\_entry.props.value") and some other things but it doesn't work, can you give me a clue ?

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 5:28pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/5 "2023-08-17T17:28:46Z")

</div>

Well I tried to add a script below the Expression binding, I was able to make it work but the problem that I had is for the update. The style was updated when I refreshed the page, and I want the style to be updated when I change the values.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 17, 2023, 5:47pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/6 "2023-08-17T17:47:38Z")

</div>

Not really following, if you change the style, then the style should update. Try changing the style in the designer to see it working, just type it in for now.

You'll need to show more of your work to really know what's going on.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 6:00pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/7 "2023-08-17T18:00:18Z")

</div>

Sure, I tried this:

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

Basically I want to change the style of a field depending of the values of this field and another field. When I tried with this script it worked, but the style was updated only when I refreshed my page, while I want the script to be updated when I enter a wrong value

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 17, 2023, 6:05pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/8 "2023-08-17T18:05:21Z")

</div>

Hover over the expression error and it will show you details on the error. From your screenshot, there is something wrong with the expression.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 6:11pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/9 "2023-08-17T18:11:37Z")

</div>

Yeah it's "normal" because the value of this field is dynamic, it depends of the page I open so the expression can't find a value in the designer, but it's actually working. The problem is for the update, the style change when I refresh the page

By the way I had something similar in the past, I had an expression following by a script like this and I had the same problem, the changes that the script was supposed to apply were applied when I updated the page

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 17, 2023, 6:14pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/10 "2023-08-17T18:14:14Z")

</div>

The transform will only execute when the expression value changes, so keep that in mind.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 6:24pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/11 "2023-08-17T18:24:09Z")

</div>

Oh okay that makes sense! I understand now, thanks for that

I guess I will try to solve my initial problem with just an expression, but can you help me for a last thing ?  
I'm not able to write properly the path of the property I want in the property() function.  
This is the initial path : {../Conductivity\_entry.props.value}  
This is the path for the value of another field that is in the same container of the field I'm writing the expression. "Conductivity" is the name of the container so I'd like to make this path dynamic  
I tried something like : property("../" + {parent.meta.name} + "\_entry.props.value")  
but it's not working, what am I doing wrong ?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 17, 2023, 6:32pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/12 "2023-08-17T18:32:07Z")

</div>

Maybe this example will help, paste JSON (right click on a view).

Change `propIndirect` and you will see `propPath` change to the value in the label, assuming it's a valid path.

```auto
{
  "custom": {
    "propIndirect": "Label_0",
    "propPath": "Label 2"
  },
  "params": {},
  "propConfig": {
    "custom.propIndirect": {
      "persistent": true
    },
    "custom.propPath": {
      "binding": {
        "config": {
          "expression": "property(\"/root/\" + {view.custom.propIndirect} + \".props.text\")"
        },
        "type": "expr"
      },
      "persistent": true
    }
  },
  "props": {},
  "root": {
    "children": [
      {
        "meta": {
          "name": "Label"
        },
        "position": {
          "height": 32,
          "width": 279,
          "x": 82,
          "y": 105
        },
        "props": {
          "text": "Label 1"
        },
        "type": "ia.display.label"
      },
      {
        "meta": {
          "name": "Label_0"
        },
        "position": {
          "height": 32,
          "width": 279,
          "x": 82,
          "y": 167
        },
        "props": {
          "text": "Label 2"
        },
        "type": "ia.display.label"
      }
    ],
    "meta": {
      "name": "root"
    },
    "type": "ia.container.coord"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 6:47pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/13 "2023-08-17T18:47:34Z")

</div>

Okay I think I got it, but I have this now:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/a/5a5835a35cd964585c5be2779e2991fb4ddabb18.png)

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

I have Ignition 8 so I should have the property function

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 17, 2023, 6:58pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/14 "2023-08-17T18:58:02Z")

</div>

If you enter the function properly the text should be blue. Maybe start smaller, create some custom props and get the `property()` working first. IMO that is cleaner anyways. Then use the custom props in your expressions.

Edit, I don't know when the function was released, the 8.1 docs don't state. The 8.0 docs do.

---

<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:** [August 17, 2023, 7:00pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/15 "2023-08-17T19:00:43Z")

</div>

> [@Alexandre\_Pasquereau](#):
>
> I have Ignition 8 so I should have the property function

According to this:

[https://docs.inductiveautomation.com/display/DOC80/property](https://docs.inductiveautomation.com/display/DOC80/property)

It was introduced in v8.0.4. Are you still on v8.0?

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 7:04pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/16 "2023-08-17T19:04:46Z")

</div>

Well I know that I'm using Ignition v8 but I can't find the complete description of the version so I don't know what version of the v8 I have, where can I find it ?  
I checked the gateway and the "about Ignition designer"

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 17, 2023, 7:09pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/17 "2023-08-17T19:09:15Z")

</div>

> [@Alexandre\_Pasquereau](#):
>
> I checked the gateway and the "about Ignition designer"

It's in both those places...

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

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 7:11pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/18 "2023-08-17T19:11:40Z")

</div>

Yes but

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/890d8dac55ecc1f2b5bdc4625997793d4cd1dc6f.png)

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

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 17, 2023, 7:12pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/19 "2023-08-17T19:12:43Z")

</div>

You might be running a nightly pre-release version of 8.0.4.

You really need to upgrade.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Pasquereau](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@Alexandre\_Pasquereau](https://forum.inductiveautomation.com/u/Alexandre_Pasquereau)\
**Post date:** [August 17, 2023, 7:14pm UTC](https://forum.inductiveautomation.com/t/expression-binding-dynamic-path-to-a-property/78010/20 "2023-08-17T19:14:30Z")

</div>

Oh okay, I'll look into it, thanks
