# runNamedQuery Script help

**URL:** <https://forum.inductiveautomation.com/t/runnamedquery-script-help/39551>\
**Category:** Ignition\
**Created:** [October 9, 2020, 6:29pm UTC](https://forum.inductiveautomation.com/t/runnamedquery-script-help/39551 "2020-10-09T18:29:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven.cox](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.cox/32/18589_2.png) [@steven.cox](https://forum.inductiveautomation.com/u/steven.cox)\
**Post date:** [October 9, 2020, 6:29pm UTC](https://forum.inductiveautomation.com/t/runnamedquery-script-help/39551/1 "2020-10-09T18:29:00Z")

</div>

Hi all,

I cannot figure out why this script fails. I have restarted Designer with the same results.

From the Script Console…

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

The binder\_select\_index query works and has a matching parameter and the commented section works as expected.

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

What am I missing?

Thanks, Steven

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [October 9, 2020, 6:37pm UTC](https://forum.inductiveautomation.com/t/runnamedquery-script-help/39551/2 "2020-10-09T18:37:55Z")

</div>

In the script console screenshot: line 2 (end of the line) **binder\_name** parameter should be **binder** perhaps.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [October 9, 2020, 6:39pm UTC](https://forum.inductiveautomation.com/t/runnamedquery-script-help/39551/3 "2020-10-09T18:39:18Z")

</div>

I think you might have flipped the dictionary parameter with it’s value

try

```auto
binder = "another binder"
binder_id = system.db.runNamedQuery("binder_select_index", {"binder_name":binder})

```

---

<div class="post-metadata">

**Author:** ![steven.cox](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.cox/32/18589_2.png) [@steven.cox](https://forum.inductiveautomation.com/u/steven.cox)\
**Post date:** [October 9, 2020, 6:48pm UTC](https://forum.inductiveautomation.com/t/runnamedquery-script-help/39551/4 "2020-10-09T18:48:10Z")

</div>

@ryan.white & @code_skin,

That’s it!!! I was looking at the parameter definition backwards!!

Thanks for your help!!

Steven
