# Null Pointer Error on drop down query and expression bindings

**URL:** <https://forum.inductiveautomation.com/t/null-pointer-error-on-drop-down-query-and-expression-bindings/104332>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [March 27, 2025, 8:03pm UTC](https://forum.inductiveautomation.com/t/null-pointer-error-on-drop-down-query-and-expression-bindings/104332 "2025-03-27T20:03:55Z")\
**Posts on this page:** 2\
**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:** [March 27, 2025, 8:03pm UTC](https://forum.inductiveautomation.com/t/null-pointer-error-on-drop-down-query-and-expression-bindings/104332/1 "2025-03-27T20:03:56Z")

</div>

Hello all,

I have a named query returning a dataset on root custom property.

The drop down component has a named query that provides a list of values to choose from. The `selectedValue` is bound to a named query that pulls a number from the DB taking an integer as a parameter.

![image](https://us1.discourse-cdn.com/inductiveautomation/optimized/3X/8/8/881498021501eb5e2c519963674e98ee3e95c590_2_690x39.png)

This integer comes from a custom property that is expression bound to a value in a dataset on the root component.

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

Here is the expression binding for the custom property that produces the error:

```python
{Root Container.sb_list_metals}[0, 'Pos_ID']

```

When I open the screen in the designer, I always get a `NullPointerException` on the drop down's custom property expression binding. But every dataset, every other bound property has the correct values, nothing missing.

If I choose `Retain Rows` on the named query binding,

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

then I don't get this error.

The drop downs:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/1/4106bc19d0ea8d92ccd80f1525a135bdd04ece55.png)

It's data  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/a/2a7bcb8f70784305a2507f41015a9a834f550b01.png)

In this case the drop down should take the value of `9` and use that as the parameter in the query binding for the `selectedValue`.

The Error details:

```python
Exception: Error executing expression binding on
Dev-Maintenance Control.Root Container.Container Metal Hours.Dropdown Position 03_1.pos_id
	caused by ExpressionException: Error performing subscript operation
	caused by NullPointerException

```

---

<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:** [March 27, 2025, 8:47pm UTC](https://forum.inductiveautomation.com/t/null-pointer-error-on-drop-down-query-and-expression-bindings/104332/2 "2025-03-27T20:47:30Z")

</div>

Think I solved this problem. I did not use `try` in the expression. 🤦‍♂️
