# Problem with expression binding on a dataset

**URL:** <https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 18, 2025, 1:45am UTC](https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652 "2025-07-18T01:45:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [July 18, 2025, 1:45am UTC](https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652/1 "2025-07-18T01:45:32Z")

</div>

Hello all,

I have a custom property on the root container with a named query binding.  
A set of drop downs with the `data` bound to a dataset (from a named query), and the `selectedValue` of the drop down is bound using an expression:

```python
try({Root Container.current_oamb_pos}[{Root Container.Container OAMB Locations.Dropdown Location 1.row},'Position_ID'], 0)

```

The `current_oamb_pos` is the dataset supporting the drop down `selectedValue`.

In the Designer, each drop down has the correct selected value, but it does not display a label or string.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0cedc5651d4d9e7d6d9699b9c7e73b26656941e0.png)

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

Once I go into Preview Mode, then the correct strings appear.  
When I open the project, and enable the trial, the correct strings in the drop down do not appear, just as in the Designer without preview mode.

I threw a table bound directly to the `.current_oamb_pos` just to make sure the data was really there when the screen loaded.

I seem to remember reading a thread on data loading via queries versus component loading and firing binding events, but I cannot seem to find it (if it really applies anyway).

What am I missing?

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [July 18, 2025, 3:57pm UTC](https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652/2 "2025-07-18T15:57:51Z")

</div>

Just want to put this near the top again. 🙂

---

<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:** [July 18, 2025, 4:08pm UTC](https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652/3 "2025-07-18T16:08:28Z")

</div>

I have no idea what might be wrong. Probably something simple you haven't shared. Perhaps you should be using the dropdown's `.selectedIndex` to pick adjacent data from the dropdown's option data.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [July 18, 2025, 4:20pm UTC](https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652/4 "2025-07-18T16:20:49Z")

</div>

I don't see a `selectedIndex` available.

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

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [July 18, 2025, 4:29pm UTC](https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652/5 "2025-07-18T16:29:40Z")

</div>

I discovered that if I replace the reference to the drop down custom property `.row` in the expression with a hard value, it works just fine.

I knew something was tickling the back of my brain on the timing of loading components, data and bindings, and I think this type of expression binding is what I was thinking of. Even though it's bound, I think if I could delay the firing of the expression or delay these particular components to load late, that may work. But I don't know if such a thing is possible.

For now, simply hard coding the row number will work just fine.

Edit:  
Also, I think I need to set the `behavior.noSelectionValue` to zero...

---

<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:** [July 18, 2025, 4:56pm UTC](https://forum.inductiveautomation.com/t/problem-with-expression-binding-on-a-dataset/108652/6 "2025-07-18T16:56:48Z")

</div>

`.selectedIndex` is not shown in the property editor, but **is** shown in the property binding selection dialog. You should use it for all indirection into the data prop.

> **[Vision - Dropdown List | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/vision-components/input/dropdown-list#properties)**
>
> The dropdown component is a great way to display a list of choices in a limited amount of space. The current selection is shown, and the choices are only presented when the user clicks on the dropdown button.
