# Passing parameters from View() Expression

**URL:** <https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [September 7, 2022, 6:20pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848 "2022-09-07T18:20:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dojeda](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dojeda](https://forum.inductiveautomation.com/u/dojeda)\
**Post date:** [September 7, 2022, 6:20pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/1 "2022-09-07T18:20:52Z")

</div>

Hi there, I'm trying to pass dataset parameters that are load from a script into a Custom Property, then I run the Expression VIEW() from Simulation Aids to Group some data, but I'm getting the following error:

Traceback (most recent call last):  
File "event:mouseReleased", line 88, in   
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.moduleInvokeSafe(GatewayInterface.java:908)  
at com.inductiveautomation.ignition.client.gateway\_interface.ModuleRPCFactory$DynamicRPCHandler.invoke(ModuleRPCFactory.java:53)  
at com.sun.proxy.$Proxy57.executeReport(Unknown Source)  
at com.inductiveautomation.reporting.scripting.ClientScriptingFunctions.executeReport(ClientScriptingFunctions.java:35)  
at com.inductiveautomation.reporting.common.scripting.ReportScriptingFunctionsPyWrapper.executeReport(ReportScriptingFunctionsPyWrapper.java:62)  
at jdk.internal.reflect.GeneratedMethodAccessor1139.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: ImportError: No module named automation\_pros

```
at org.python.core.Py.JavaError(Py.java:547)
at org.python.core.Py.JavaError(Py.java:538)
at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:192)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:546)
at org.python.core.PyObject. __call__ (PyObject.java:400)
at org.python.pycode._pyx195.f$0(<event:mouseReleased>:95)
at org.python.pycode._pyx195.call_function(<event:mouseReleased>)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1687)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:806)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
at com.sun.proxy.$Proxy59.mouseReleased(Unknown Source)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.desktop/java.awt.Component.processEvent(Unknown Source)
at java.desktop/java.awt.Container.processEvent(Unknown Source)
at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(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(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at com.inductiveautomation.snap.swing.RibsEventQueue.dispatchEvent(RibsEventQueue.java:99)
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)

```

Caused by: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: ImportError: No module named automation\_pros  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.moduleInvokeSafe(GatewayInterface.java:908)  
at com.inductiveautomation.ignition.client.gateway\_interface.ModuleRPCFactory$DynamicRPCHandler.invoke(ModuleRPCFactory.java:53)  
at com.sun.proxy.$Proxy57.executeReport(Unknown Source)  
at com.inductiveautomation.reporting.scripting.ClientScriptingFunctions.executeReport(ClientScriptingFunctions.java:35)  
at com.inductiveautomation.reporting.common.scripting.ReportScriptingFunctionsPyWrapper.executeReport(ReportScriptingFunctionsPyWrapper.java:62)  
at jdk.internal.reflect.GeneratedMethodAccessor1139.invoke(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:190)  
... 44 more  
Caused by: ImportError: No module named automation\_pros

```
at org.python.core.Py.ImportError(Py.java:329)
at org.python.core.imp.import_logic(imp.java:1290)
at org.python.core.imp.import_module_level(imp.java:1369)
at org.python.core.imp.importName(imp.java:1504)
at org.python.core.PyType$TypeResolver.readResolve(PyType.java:2674)
at jdk.internal.reflect.GeneratedMethodAccessor738.invoke(null)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(null)
at java.lang.reflect.Method.invoke(null)
at java.io.ObjectStreamClass.invokeReadResolve(null)
at java.io.ObjectInputStream.readOrdinaryObject(null)
at java.io.ObjectInputStream.readObject0(null)
at java.io.ObjectInputStream.defaultReadFields(null)
at java.io.ObjectInputStream.readSerialData(null)
at java.io.ObjectInputStream.readOrdinaryObject(null)
at java.io.ObjectInputStream.readObject0(null)
at java.io.ObjectInputStream.readObject(null)
at java.io.ObjectInputStream.readObject(null)
at java.util.concurrent.ConcurrentHashMap.readObject(null)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(null)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(null)
at java.lang.reflect.Method.invoke(null)
at java.io.ObjectStreamClass.invokeReadObject(null)
at java.io.ObjectInputStream.readSerialData(null)
at java.io.ObjectInputStream.readOrdinaryObject(null)
at java.io.ObjectInputStream.readObject0(null)
at java.io.ObjectInputStream.defaultReadFields(null)
at java.io.ObjectInputStream.readSerialData(null)
at java.io.ObjectInputStream.readOrdinaryObject(null)
at java.io.ObjectInputStream.readObject0(null)
at java.io.ObjectInputStream.readObject(null)
at java.io.ObjectInputStream.readObject(null)
at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.ModuleInvoke.decodeToObject(ModuleInvoke.java:212)
at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.ModuleInvoke.invoke(ModuleInvoke.java:104)
at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:431)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at com.inductiveautomation.catapult.handlers.RemoteHostNameLookupHandler.handle(RemoteHostNameLookupHandler.java:116)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.lang.Thread.run(null)

```

Ignition v8.1.11 (b2021101912)  
Java: Azul Systems, Inc. 11.0.11

and here is the script I'm trying to run:

# Create Graphs Getting data from Custom Property with View() Expression

dt\_seb = event.source.parent.DT\_SCRIPT\_FORM\_1  
dt\_fc = event.source.parent.DT\_SCRIPT\_FORM\_2

graphs = system.report.executeReport(path="STAMPING\_REP/DT\_SCRIPT\_REPORT\_STAMPING", project="ANDON-KTMEX", parameters = {"DT\_SEBANGO" : dt\_seb, "DT\_FAULT\_CODE" : dt\_fc}, fileType="xlsx")

# set file path to save the graphs

filepath\_2 = 'c:/FISReports/' + filename\_2

# write the file

system.file.writeFile(filepath\_2, graphs)

# open the file

if filepath != None:  
system.net.openURL("file://"+filepath\_2)

Please, any ideas why is not accepting this, When I force the dataset report parameters it works.  
Thanks!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 7, 2022, 6:23pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/2 "2022-09-07T18:23:28Z")

</div>

> [@dojeda](#):
>
> Caused by: ImportError: No module named automation\_pros

Something appears to be wrong with the module or your installation of it.

---

<div class="post-metadata">

**Author:** ![dojeda](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dojeda](https://forum.inductiveautomation.com/u/dojeda)\
**Post date:** [September 7, 2022, 6:30pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/3 "2022-09-07T18:30:44Z")

</div>

When I checked in the designer the values of the custom property, they look correct and the View() expression is doing what I want, is only when it runs the script has the issue.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 7, 2022, 6:42pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/4 "2022-09-07T18:42:05Z")

</div>

perhaps @pturmel has some insight? Definitely seems as if there is something goofy going on with the module installation.

Do you have other places where functions from the Simulation Aids module is working correctly in the client?

---

<div class="post-metadata">

**Author:** ![dojeda](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dojeda](https://forum.inductiveautomation.com/u/dojeda)\
**Post date:** [September 7, 2022, 6:46pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/5 "2022-09-07T18:46:18Z")

</div>

Thanks for the insights, and No only on this part I started to use the VIEW() Expression to process a Dataset, that is being constructed with in a script that I run in this window.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 7, 2022, 7:25pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/6 "2022-09-07T19:25:40Z")

</div>

You’re trying to use `view()` in a script? You can’t do that. It’s an expression only. I’ve requested a similar functionality to @pturmel but right now its an expression only. Edit: seems like you’re just using it in a custom property hmm. Also to post your script use  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/929d63ad93699b94994025c655a4a81d6cc19fce.png) or triple back ticks - its very hard to read your code and diagnose

```

```auto
code here

```

```

Are you using a scripting datasource in your report or an expression in your report that uses the `view` function? I don’t see anything in your current script referencing view or any other automation pros functionality. If you are show that.

---

<div class="post-metadata">

**Author:** ![dojeda](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dojeda](https://forum.inductiveautomation.com/u/dojeda)\
**Post date:** [September 7, 2022, 10:13pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/7 "2022-09-07T22:13:57Z")

</div>

Hi, Sure My code is:

````auto
```# Create Graphs
graphs = system.report.executeReport(path="STAMPING_REP/DT_SCRIPT_REPORT_STAMPING", project="ANDON-KTMEX", parameters = {"DT_DATA" : dataIn_5}, fileType="xlsx")
# set file path to save the graphs
filepath_2 = 'c:/FISReports/' + filename_2
# write the file
system.file.writeFile(filepath_2, graphs)
# open the file
if filepath != None:
   system.net.openURL("file://"+filepath_2)
# Create Graphs
graphs = system.report.executeReport(path="STAMPING_REP/DT_SCRIPT_REPORT_STAMPING", project="ANDON-KTMEX", parameters = {"DT_DATA" : dataIn_5}, fileType="xlsx")
# set file path to save the graphs
filepath_2 = 'c:/FISReports/' + filename_2
# write the file
system.file.writeFile(filepath_2, graphs)
# open the file
if filepath != None:
   system.net.openURL("file://"+filepath_2)

````

But Found the Solution, the problem seems that runing the expression VIEW() in a custom property, then grabbing it back in a script for some reason doesn’t run the system.report.executeReport. What I endup doing is that I sent the entired raw dataset as a parameter to the report, and inside the report in a parameter I configure the View() Expression in the Raw Dataset and it worked.  
Thanks everybody for your help

```auto

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 8, 2022, 12:56am UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/8 "2022-09-08T00:56:05Z")

</div>

The view() expression function, when its logger is set to DEBUG, will place in the log the internal jython script that it produces to actually perform the operation. You can cut that and paste it into a project library script as a function with suitable parameters and call that in your other scripts.

In gateway scope, the module’s jars are entirely hidden within the module’s own classloader. Only the explicitly documented script functions are accessible from jython.

---

<div class="post-metadata">

**Author:** ![dojeda](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dojeda](https://forum.inductiveautomation.com/u/dojeda)\
**Post date:** [September 8, 2022, 2:55pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/9 "2022-09-08T14:55:50Z")

</div>

Hi @pturmel, thanks for the explanation and at the end I got it working with the view() expression done in the report designer. Just one questions, How do you setup de DEBUG mode to see the jython script?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 8, 2022, 3:06pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/10 "2022-09-08T15:06:29Z")

</div>

For gateway scope, go to the Status =\> Logs page, click on the gear icon, search for 'automation\_pros", then find logger for `view()`. Set it to DEBUG.

In the designer or vision client, open the diagnostics window from the Help menu, then select the log levels tab.

---

<div class="post-metadata">

**Author:** ![dojeda](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@dojeda](https://forum.inductiveautomation.com/u/dojeda)\
**Post date:** [September 8, 2022, 5:14pm UTC](https://forum.inductiveautomation.com/t/passing-parameters-from-view-expression/63848/11 "2022-09-08T17:14:00Z")

</div>

Thank you soo much, will try this out too.
