I think I resolved the previous error but got a new error message below.
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 7, in File "", line 7, in updateTagBasedOnSelection TypeError: toDataSet(): 1st arg can't be coerced to com.inductiveautomation.ignition.common.script.builtin.DatasetUtilities$PyDataSet
at org.python.core.Py.TypeError(Py.java:236)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:213)
at org.python.core.PyReflectedFunction.throwBadArgError(PyReflectedFunction.java:316)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:325)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:171)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:208)
at org.python.core.PyObject.call(PyObject.java:461)
at org.python.core.PyObject.call(PyObject.java:465)
at org.python.pycode._pyx72.updateTagBasedOnSelection$1(:13)
at org.python.pycode._pyx72.call_function()
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:187)
at org.python.core.PyFunction.call(PyFunction.java:449)
at org.python.pycode._pyx71.f$0(:7)
at org.python.pycode._pyx71.call_function()
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:803)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:823)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:751)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:804)
at com.inductiveautomation.ignition.common.script.TagChangeScriptExecutor$TagChangeExecutionCallback.execute(TagChangeScriptExecutor.java:242)
at com.inductiveautomation.ignition.common.script.TagChangeScriptExecutor$TagChangeExecutionCallback.execute(TagChangeScriptExecutor.java:194)
at com.inductiveautomation.ignition.common.util.SerialExecutionQueue$PollAndExecute.run(SerialExecutionQueue.java:102)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.python.core.PyException: TypeError: toDataSet(): 1st arg can't be coerced to com.inductiveautomation.ignition.common.script.builtin.DatasetUtilities$PyDataSet
... 30 common frames omitted