# Search db and pop up

**URL:** <https://forum.inductiveautomation.com/t/search-db-and-pop-up/91196>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 31, 2024, 12:51pm UTC](https://forum.inductiveautomation.com/t/search-db-and-pop-up/91196 "2024-05-31T12:51:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milan\_Gopal](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@Milan\_Gopal](https://forum.inductiveautomation.com/u/Milan_Gopal)\
**Post date:** [May 31, 2024, 12:51pm UTC](https://forum.inductiveautomation.com/t/search-db-and-pop-up/91196/1 "2024-05-31T12:51:45Z")

</div>

```
if system.db.runNamedQuery("IPList/IP_Insert",{"IPAddress"})==self.getSibling("IPAddressTXT").props.text:
	system.perspective.openPopup(1, IP/PopUp);

```

I am trying to search a db for a text and if it exits a pop up must display

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 31, 2024, 1:04pm UTC](https://forum.inductiveautomation.com/t/search-db-and-pop-up/91196/2 "2024-05-31T13:04:07Z")

</div>

Show us your named query.  
If you are trying to pass a parameter it should look like,

```python
params = {"ipAddress": IPAddress}
val = system.db.runNamedQuery("IPList/IP_Insert", params)
if val == self.getSibling("IPAddressTXT").props.text:
	system.perspective.openPopup(1, IP/PopUp)

```

For this to work your query would have to be a Scalor type and return a single value rather than a dataset.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 31, 2024, 3:02pm UTC](https://forum.inductiveautomation.com/t/search-db-and-pop-up/91196/3 "2024-05-31T15:02:00Z")

</div>

Also,

> [@Milan\_Gopal](#):
>
> `system.perspective.openPopup(1, IP/PopUp);`

1. `IP/Popup` must be a string: `"IP/Popup"`.
2. Use of `1` as a Popup `id` is not a good idea.
3. There's no need for the `;` at the end of the line.
