# How to run a named query from a button within persepective?

**URL:** <https://forum.inductiveautomation.com/t/how-to-run-a-named-query-from-a-button-within-persepective/21505>\
**Category:** Ignition Early Access\
**Created:** [December 19, 2018, 5:05pm UTC](https://forum.inductiveautomation.com/t/how-to-run-a-named-query-from-a-button-within-persepective/21505 "2018-12-19T17:05:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![john.schlottke](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@john.schlottke](https://forum.inductiveautomation.com/u/john.schlottke)\
**Post date:** [December 19, 2018, 5:05pm UTC](https://forum.inductiveautomation.com/t/how-to-run-a-named-query-from-a-button-within-persepective/21505/1 "2018-12-19T17:05:33Z")

</div>

What is the best way to run a named query from a button click event and pass in parameters?

---

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [January 4, 2019, 12:10am UTC](https://forum.inductiveautomation.com/t/how-to-run-a-named-query-from-a-button-within-persepective/21505/2 "2019-01-04T00:10:12Z")

</div>

You could create a script action on the button click event. In the script, you could invoke system.db.runNamedQuery(…)

See: [https://docs.inductiveautomation.com/display/DOC80/system.db.runNamedQuery](https://docs.inductiveautomation.com/display/DOC80/system.db.runNamedQuery)
