Script Over-running

I am working in Ignition Vision 8.1 ....

I have a pop-up window with a number of custom properties. The custom properties are linked to fields by way of indirect parameters.

One of the indirect custom properties is an integer. This integer is run through a named query to retrieve a text value for a text label.

On initial opening of the screen, I receive a failure (every time)

java.lang.Exception: Named Query returned no rows on component: Motor Module Diagnostics.Root Container.Error Text.text
	at com.inductiveautomation.factorypmi.application.binding.NamedQueryAdapter.handleQueryReturnedNoRows(NamedQueryAdapter.java:284)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$HandleNoRowsTask.run(QueryManager.java:518)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v8.1.44 (b2024102210)
Java: Azul Systems, Inc. 17.0.12

The query is successfully run, and the data is displayed - but I am trying to understand why I get the failure. I think it is because of when the script is being run. I have numeric values for 0, as well as any other integer that may be in custom property. I suspect the scripts are running in a different order than I want - any suggestions?

Is the integer the only parameter used in the NQ? Or if others, are they all available in properties? If so, don't use a scripted named query, but a named query binding instead.

Be aware that properties can have a null initial value, briefly, in some cases, and that can cause no match in a query that uses it.

The integer is the only parameter in the named query. I have the query bound to the text label - not directly scripted in a screen load. Does this follow your suggestion?

Hmmm. Yes.

Have you set the NQ binding to return a scalar? If so, did you set a fallback value?