# Bidirectional expression binding for Text Field?

**URL:** <https://forum.inductiveautomation.com/t/bidirectional-expression-binding-for-text-field/23819>\
**Category:** Ignition\
**Created:** [April 3, 2019, 4:32pm UTC](https://forum.inductiveautomation.com/t/bidirectional-expression-binding-for-text-field/23819 "2019-04-03T16:32:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [April 3, 2019, 4:32pm UTC](https://forum.inductiveautomation.com/t/bidirectional-expression-binding-for-text-field/23819/1 "2019-04-03T16:32:05Z")

</div>

I have a display showing PV and SP for 10 out of 1000 PID blocks. It displays correctly, but I want to change the SP of the tag. Since the format of my tags is “PDxxxx”, I use an expression binding using the index for the associated display element as shown. The problem is that unlike tag binding, expression binding does not provide a bidirectional ability in the Text Field component.

Is there a way to provide bidirectional SP change in this application?

 ![ig_expbindingbidirect_01](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7e82501a9325feab71cbab70c37a74fa5a6c3a7d.jpeg)

---

<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:** [April 3, 2019, 4:35pm UTC](https://forum.inductiveautomation.com/t/bidirectional-expression-binding-for-text-field/23819/2 "2019-04-03T16:35:25Z")

</div>

Don’t use the tag() expression function. (Like, _never_.) It exists for backwards compatibility. Use indirect tag binding instead, where all or part of the tag path is kept in a separate custom string property. Indirect tag bindings can be bidirectional.

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [April 3, 2019, 10:26pm UTC](https://forum.inductiveautomation.com/t/bidirectional-expression-binding-for-text-field/23819/3 "2019-04-03T22:26:41Z")

</div>

Yudaman ptumel!

I don’t know if I chose the best way to do it, but here is what I did:

- Created 10 integer tags (PDIndex) to hold the index of the PID loop
- Created 10 expression tags (PDTag) to convert the 10 PDIndex tags to a string with the tag path to the PID SP tag
- Created 10 custom properties (PDTag) of type string on the root of the window with a binding to the PDTags
- Bound the Text Field components to the custom property PDTags

It works!

 ![ig_expbindingbidirect_02](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/140350acfc38be7a12405f4e69823ff8152842f3.jpeg)

 ![ig_expbindingbidirect_03](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/97b5acb8d1989acc727a5c7acf60524bf7529396.jpeg)

---

<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:** [April 4, 2019, 12:20am UTC](https://forum.inductiveautomation.com/t/bidirectional-expression-binding-for-text-field/23819/4 "2019-04-04T00:20:59Z")

</div>

Most wouldn’t bother with the integer tags and expression tags – they just make the window only usable by one client at a time. The common approach would be to leave the strings unbound, supplying them as parameters to the window. In any case, you can convert integers to strings with a binding expression instead of an expression tag.

---

<div class="post-metadata">

**Author:** ![Bradley\_Peay](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@Bradley\_Peay](https://forum.inductiveautomation.com/u/Bradley_Peay)\
**Post date:** [January 25, 2022, 8:11pm UTC](https://forum.inductiveautomation.com/t/bidirectional-expression-binding-for-text-field/23819/5 "2022-01-25T20:11:16Z")

</div>

Bumping for the Perspective crowd, this works beautifully in perspective.
