# runNamedQuery()

**URL:** <https://forum.inductiveautomation.com/t/runnamedquery/68073>\
**Category:** Ignition\
**Created:** [December 29, 2022, 5:52pm UTC](https://forum.inductiveautomation.com/t/runnamedquery/68073 "2022-12-29T17:52:24Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![jacque\_trahan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jacque_trahan/32/58886_2.png) [@jacque\_trahan](https://forum.inductiveautomation.com/u/jacque_trahan)\
**Post date:** [February 19, 2024, 10:08pm UTC](https://forum.inductiveautomation.com/t/runnamedquery/68073/14 "2024-02-19T22:08:36Z")

</div>

One more aspect to be aware of/may save you some time in the future. This got me good for a while on fully understanding the different scopes.

I was using the runNamedQuery() in the alarm pipeline and I forgot that is a Gateway scope module. So the name of my project needed to be added. Took me way longer to figure out than it should have.

example:  
Script console ([designer scope?](https://www.docs.inductiveautomation.com/docs/8.1/platform/designer/designer-tools/script-console) only works in designer):

```auto
db = system.db.runNamedQuery("Your Saved Name Query", {"pram1":"value",etc})

```

vs the alarm pipeline (Gateway scope)

```auto
db = system.db.runNamedQuery("ProjectName", "Your Saved Name Query", {"pram1":"value",etc})

```

If needed this post is really good at [knowing what scope](https://forum.inductiveautomation.com/t/can-i-tell-what-scope-a-script-is-running-from/70880) a script is coming from

---

_[View the full topic](https://forum.inductiveautomation.com/t/runnamedquery/68073)._
