# Switch user script can not performed

**URL:** <https://forum.inductiveautomation.com/t/switch-user-script-can-not-performed/78190>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 22, 2023, 4:50am UTC](https://forum.inductiveautomation.com/t/switch-user-script-can-not-performed/78190 "2023-08-22T04:50:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![govind](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@govind](https://forum.inductiveautomation.com/u/govind)\
**Post date:** [August 22, 2023, 4:50am UTC](https://forum.inductiveautomation.com/t/switch-user-script-can-not-performed/78190/1 "2023-08-22T04:50:04Z")

</div>

Hello friends,

I got error when try to switch user function.

```python
Traceback (most recent call last):
  File "<event:actionPerformed>", line 5, in <module>
AttributeError: 'NoneType' object has no attribute 'text'

	at org.python.core.Py.AttributeError(Py.java:178)
	at org.python.core.PyObject.noAttributeError(PyObject.java:965)
	at org.python.core.PyObject. __getattr__ (PyObject.java:959)
	at org.python.pycode._pyx6.f$0(<event:actionPerformed>:16)
	at org.python.pycode._pyx6.call_function(<event:actionPerformed>)
	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.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:207)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:300)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
	at com.sun.proxy.$Proxy49.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.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 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.30 (b2023071408)  
Java: Azul Systems, Inc. 11.0.18

I created three different user with defined user roles.

Configured a script in ok button which one attached in pictures.

PFA pictures for your references.

 ![script for switch user](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/0/d0697b226541764bff4580a0d3ae8ccc7dcb53a7.png)  
 ![switch user](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3edaad55e7627094bfe9893bf707852240b4f16a.png)  
 ![User popup window](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5d4d95bec15e4c38d2c0b9baae0c5d9d157779c.png)

---

<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:** [August 22, 2023, 9:59am UTC](https://forum.inductiveautomation.com/t/switch-user-script-can-not-performed/78190/2 "2023-08-22T09:59:56Z")

</div>

Screen shots are not as helpful as you might think, please also provide preformatted code as well.

The path to one of your text field components is not correct. I can’t tell which one as you’ve cut off the line numbers.

Use the property selector to insure you have the correct path to the components.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 22, 2023, 10:12am UTC](https://forum.inductiveautomation.com/t/switch-user-script-can-not-performed/78190/3 "2023-08-22T10:12:12Z")

</div>

@govind You can check the component's path.

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

drag your component path from the insert property reference for more information see the below screenshot:

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

---

<div class="post-metadata">

**Author:** ![Learner\_Ignition](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Learner\_Ignition](https://forum.inductiveautomation.com/u/Learner_Ignition)\
**Post date:** [August 22, 2023, 10:15am UTC](https://forum.inductiveautomation.com/t/switch-user-script-can-not-performed/78190/4 "2023-08-22T10:15:20Z")

</div>

I think you had copied the script from Manual but did not made any changes according to your project.

---

<div class="post-metadata">

**Author:** ![govind](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@govind](https://forum.inductiveautomation.com/u/govind)\
**Post date:** [August 23, 2023, 10:41am UTC](https://forum.inductiveautomation.com/t/switch-user-script-can-not-performed/78190/5 "2023-08-23T10:41:51Z")

</div>

Thank you,

Yes, I copied the script from the manual and did not configure the property.

So, configure the property as per shared by you.

It's working .
