# Database not updating across perspective instances

**URL:** <https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 6, 2025, 7:58pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220 "2025-10-06T19:58:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryder\_risic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryder_risic/32/79824_2.png) [@ryder\_risic](https://forum.inductiveautomation.com/u/ryder_risic)\
**Post date:** [October 6, 2025, 7:58pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/1 "2025-10-06T19:58:39Z")

</div>

Hi, I am fairly new to ignition and perspective, so I don’t know if this is a database setup issue or some simple thing I wasn’t aware of:  
I am trying to have a simple check in “app” using perspective web browser capabilities. The idea is guests scan a QR code that takes them to the perspective page URL where they input the following:

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

I have this script right now onAction for my button that references the following named query:

```python
def runAction(self, event):
    first = self.getSibling("TextField").props.text
    last = self.getSibling("TextField_0").props.text
    dep = self.getSibling("Dropdown").props.value
    system.db.runNamedQuery("insertCheckin", {
        "first_name": first,
        "last_name": last,
        "department": dep
        })  

```

```python
INSERT INTO event_checkins (first_name, last_name, department)
VALUES (:first_name, :last_name, :department)

```

This setup DOES work when I playtest it in the designer and watch it log into the db using the query browser tool. However when I open an instance in the web browser none of my inputs do anything. The database never gets updated unless I do it locally in the designer.  
I don’t know if there are security settings or anything like that so any help identifying this issue would be appreciated.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [October 6, 2025, 8:06pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/2 "2025-10-06T20:06:58Z")

</div>

Have a look in the gateway logs, is there any new entries?

---

<div class="post-metadata">

**Author:** ![ryder\_risic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryder_risic/32/79824_2.png) [@ryder\_risic](https://forum.inductiveautomation.com/u/ryder_risic)\
**Post date:** [October 6, 2025, 8:11pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/3 "2025-10-06T20:11:13Z")

</div>

Is this what you mean? I’ll be honest I didn’t know you could look at db logs in the gateway.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/a/ca9c70af635745f4f14fbc0a9faee9b209465c88.png)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [October 6, 2025, 8:13pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/4 "2025-10-06T20:13:42Z")

</div>

While this DB log shows the query was actually sent, the gateway logs `> STATUS > LOGS` will normally have the errors that come back from the database if they occur.

---

<div class="post-metadata">

**Author:** ![ryder\_risic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryder_risic/32/79824_2.png) [@ryder\_risic](https://forum.inductiveautomation.com/u/ryder_risic)\
**Post date:** [October 6, 2025, 8:20pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/5 "2025-10-06T20:20:39Z")

</div>

Ok when I try to checkin on the web browser i get this:  
`ClientSession	06Oct2025 16:19:05	Received event for missing view "Checkin@C"`

My main view is named “Checkin”. Not sure what the @C is.

---

<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:** [October 6, 2025, 8:24pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/6 "2025-10-06T20:24:59Z")

</div>

Two checks here (but I think they're irrelevant after your last post while I typed this):

1. Check that in your named query Authoring tab that the Query Type is set to 'Update' rather than 'Query'.
2. Check the named query path. The easiest way to avoid errors is to right-click on the named query in Project Browser, Copy Path, and paste that into you `system.db.runNamedQuery("<paste here>"...)`.

Maybe look in Project Browser for a stray script icon (lightning icon) in the view or view components. Is there a chance the view is also reacting to the click.

---

<div class="post-metadata">

**Author:** ![ryder\_risic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryder_risic/32/79824_2.png) [@ryder\_risic](https://forum.inductiveautomation.com/u/ryder_risic)\
**Post date:** [October 6, 2025, 8:25pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/7 "2025-10-06T20:25:46Z")

</div>

Thanks will try that  
investigating this as well. I think this is the problem:

> [@OnClick Navigate Event "Received event for missing view"](https://forum.inductiveautomation.com/t/onclick-navigate-event-received-event-for-missing-view/86541/8):
>
> I think it is a race condition. When I have a Navigate action as well as a script action, some of the scripted statements, specifically system.perspective.sendMessage ends up without a source to be executed from and I get a Warning log "Received event for missing view ". I think the intended receiver can't trust a message without a source so the message handler is rejecting the message. Changing the order of the script and the navigate actions doesn't make a difference. The fix is simple: d…

edit: Yup got it. Tricky business with events I guess. Thanks guys

---

<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:** [October 6, 2025, 8:29pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/8 "2025-10-06T20:29:03Z")

</div>

That's likely the culprit and fix. It was in the back of my mind slowly percolating to the front.

---

<div class="post-metadata">

**Author:** ![ryder\_risic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryder_risic/32/79824_2.png) [@ryder\_risic](https://forum.inductiveautomation.com/u/ryder_risic)\
**Post date:** [October 6, 2025, 8:30pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/9 "2025-10-06T20:30:34Z")

</div>

What's interesting is that it didn’t break when play testing in the designer? Because its the same code and race condition you think it would execute the same? Or is it because in the designer you don’t actually navigate anywhere when you execute a navigation action.

---

<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:** [October 6, 2025, 8:34pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/10 "2025-10-06T20:34:55Z")

</div>

A tip that most of us would recommend:

- Create custom properties on the view for first, last, and dep.
- Bind each of the fields / dropdowns to their custom prop.

Now your runAction becomes:

```python
def runAction(self, event):
    system.db.runNamedQuery("insertCheckin", {
        "first_name": view.custom.first,
        "last_name": view.custom.last,
        "department": view.custom.dep
    })  

```

This is shorter, easier to read and has the big advantage that your code won't break if you move a component in or out of a container.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [October 6, 2025, 9:01pm UTC](https://forum.inductiveautomation.com/t/database-not-updating-across-perspective-instances/111220/11 "2025-10-06T21:01:48Z")

</div>

Navigate does nothing in designer, so that would be it.  
I would suggest never stacking the event actions in the events, use a piece of script to call the actions you need in order. The named query returns a value when it succeeds, so you can use the return value for error checking as well as enabling the next function to complete.
