# Dynamic Bidirectional Property Binding

**URL:** <https://forum.inductiveautomation.com/t/dynamic-bidirectional-property-binding/99730>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 12, 2024, 5:00am UTC](https://forum.inductiveautomation.com/t/dynamic-bidirectional-property-binding/99730 "2024-12-12T05:00:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Alsaadi](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ahmed\_Alsaadi](https://forum.inductiveautomation.com/u/Ahmed_Alsaadi)\
**Post date:** [December 12, 2024, 5:00am UTC](https://forum.inductiveautomation.com/t/dynamic-bidirectional-property-binding/99730/1 "2024-12-12T05:00:53Z")

</div>

Hi all,

I'm building a dashboard composed of multiple "modules," each with its own settings and parameters. Some of these parameters share common names, such as `xRunning` and `ModeHMI`. To manage these efficiently, I've used embedded views and passed the necessary props from parent to child where applicable.

To avoid manually adding every prop for every module, I created a module template and duplicated it for each module. My goal is to dynamically add the common properties.

Currently, I’m using an expression statement with the `property()` method, combined with a custom property on the module's view that specifies the module name. For example:

```python
property("view.params."+{view.custom.module_name}+".ModeHMI")  

```

The reason for why `{view.custom.module_name}` is necessary is because the params of each module/view are wrapped as a JSON object as this makes it MUCH easier to manage the params. e.g. where module\_name = AnodeControl

```python
AnodeControl {
  "ModeHMI": 0,
  "xRunHMI": 0,
  "xRunning": 0,
 }

```

This works well for displaying information in labels, but I also need to enable bidirectional binding to write back to the parameters. Directly using tags isn’t an option, as the tags are further up the embedded view chain.

Does anyone know if this kind of functionality is achievable?

Thank you!

---

<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:** [December 12, 2024, 1:15pm UTC](https://forum.inductiveautomation.com/t/dynamic-bidirectional-property-binding/99730/2 "2024-12-12T13:15:49Z")

</div>

Dynamically accessing properties via `property()` is fundamentally uni-directional. Consider just not including the module name in the embedded view's custom props.

Also, if anything needs to be bidirectional with tags, you should be passing tag path string properties to your views.

Meanwhile, "modules" is a terrible name. It is already applied to two major technologies in Ignition, using it is just going to exacerbate the confusion. Consider "block" or "assembly" or something else unique.

---

<div class="post-metadata">

**Author:** ![Ahmed\_Alsaadi](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ahmed\_Alsaadi](https://forum.inductiveautomation.com/u/Ahmed_Alsaadi)\
**Post date:** [December 16, 2024, 1:34am UTC](https://forum.inductiveautomation.com/t/dynamic-bidirectional-property-binding/99730/3 "2024-12-16T01:34:10Z")

</div>

Thank you, this has led me down the right path.

For anyone curious or stuck in the same situation, what I ended up doing was to add an expression to a custom property `tag_path` which created a tag path based on the bay\_number passed down from the parent view.

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

I could then use indirect tag bindings on my Perspective Components.

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

As for the naming, unfortunately we've ran the idea of **Functional Modules** _everywhere_ in our control systems architecture long before we started work on the HMI. Each Perspective HMI module maps to a hardware Functional Module, so changing it would be inconsistent and confusing.

---

<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:** [December 16, 2024, 2:44am UTC](https://forum.inductiveautomation.com/t/dynamic-bidirectional-property-binding/99730/4 "2024-12-16T02:44:06Z")

</div>

I think `fmod` would be a reasonable disambiguation for your use case, in place of `module`.
