# \[IGN-8167\]Expression structure binding woes

**URL:** <https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 7, 2023, 4:42am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533 "2023-08-07T04:42:18Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 7, 2023, 4:42am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/1 "2023-08-07T04:42:18Z")

</div>

It's simpler to add them into an object property and just bind to the object. I don't particularly like expression structures for simply monitoring a number of properties (which is the only way you really _should_ be using them), since they're a bit frustrating to setup. They shouldn't have a default value, that just makes it more annoying as you have to select all and delete it before you add your expression / property binding. Minor gripe, but it slows down the whole process when there's no reason it should have to

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 7, 2023, 6:46am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/2 "2023-08-07T06:46:17Z")

</div>

I agree that it's annoying, but it's a small price to pay.  
I'd rather remove a few default values than add clutter to my components by adding properties that are used only for that.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 7, 2023, 6:51am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/3 "2023-08-07T06:51:02Z")

</div>

Adding separate properties is far better for troubleshooting though - I rarely don't use this method, otherwise troubleshooting expressions is a nightmare

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 7, 2023, 6:54am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/4 "2023-08-07T06:54:51Z")

</div>

Well I do use separate properties, which I bind to in a structure binding. Unless they're very simple expressions.  
But that's one more reason not to have yet another property that's used solely for grouping the other ones to avoid structure bindings.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 7, 2023, 6:58am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/5 "2023-08-07T06:58:42Z")

</div>

oh, I see what you mean now 👍

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 7, 2023, 7:06am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/6 "2023-08-07T07:06:01Z")

</div>

I think it's the only way to bind to multiple queries anyway.

---

<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:** [August 7, 2023, 5:28pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/7 "2023-08-07T17:28:52Z")

</div>

> [@nminchin](#):
>
> They shouldn't have a default value, that just makes it more annoying as you have to select all and delete it before you add your expression / property binding.

Do you just mean that they shouldn't have the `"value"` expression prepopulated, and instead should start totally blank? Or something else?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 7, 2023, 5:34pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/8 "2023-08-07T17:34:27Z")

</div>

Yes, frankly it would be much better without that `"value"`.

---

<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:** [August 7, 2023, 5:34pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/9 "2023-08-07T17:34:34Z")

</div>

Blank would be good.

---

<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:** [August 7, 2023, 5:41pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/10 "2023-08-07T17:41:34Z")

</div>

I guess the downside there is this:

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

But then again, it's also a pretty clear error, so not the end of the world.

---

<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:** [August 7, 2023, 5:43pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/11 "2023-08-07T17:43:05Z")

</div>

Could it be pre-selected so that it gets deleted with a single key-press or function insertion?

---

<div class="post-metadata">

**Author:** ![Tim\_Carlton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_carlton/32/52835_2.png) [@Tim\_Carlton](https://forum.inductiveautomation.com/u/Tim_Carlton)\
**Post date:** [August 7, 2023, 5:43pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/12 "2023-08-07T17:43:59Z")

</div>

Are you expecting us to read error messages?

---

<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:** [August 7, 2023, 5:46pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/13 "2023-08-07T17:46:31Z")

</div>

> [@Use CSS Variable instead of Python Script](https://forum.inductiveautomation.com/t/use-css-variable-instead-of-python-script/77501/16):
>
> Are you expecting us to read error messages?

😂

> [@Transistor](#):
>
> Could it be pre-selected so that it gets deleted with a single key-press or function insertion?

Ah, that's interesting. When you open an expression structure on an existing object, it doesn't pre-select anything, but when you create a brand new one it does auto-focus the key.

So given:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/4/a483730418d33de4f70c7bb566291e8c3a3dfdf1.png)  
You want:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c1878885c3c094a877d85078453b2ef8e67c7e98.png)

And maybe also if you click the fx?:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/3/e3f9c241485c4fd204bf1164a640fcc7fa7476e3.png)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 7, 2023, 5:52pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/14 "2023-08-07T17:52:42Z")

</div>

The infuriating part is that if you delete the "value" then click the `fx` button, it comes back !

---

<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:** [August 7, 2023, 6:12pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/15 "2023-08-07T18:12:43Z")

</div>

Alright, let's see if I've got the wishlist here:

> 1. Don't default every value to the expression `"value"` - no content is fine, the error message is clear enough and it's annoying to click through and delete
> 2. When creating an expression structure binding from an existing object, ensure focus is passed into the first value in the structure, so users don't have to do extra clicking.
> 3. When invoking the popup expression helper, ensure the entire existing text is selected, so it can be easily removed if not applicable.
> 4. When invoking the popup expression helper, commit any pending updates in the 'raw' JsonEditor so that you don't have to remake any changes

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 7, 2023, 6:19pm UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/16 "2023-08-07T18:19:53Z")

</div>

I don't care about #2, but I believe any of the other 3 would solve the issue for me, particularly #1 and #3

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [August 8, 2023, 2:06am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/17 "2023-08-08T02:06:06Z")

</div>

when fx is clicked, only option is expression binding. Could it be possible include indirect binding as well..

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 8, 2023, 6:20am UTC](https://forum.inductiveautomation.com/t/ign-8167-expression-structure-binding-woes/77533/18 "2023-08-08T06:20:46Z")

</div>

That would be super neat, but it would bloat the UI I'm afraid.
