# Session Events in designer startUp not running

**URL:** <https://forum.inductiveautomation.com/t/session-events-in-designer-startup-not-running/112352>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 21, 2025, 8:29am UTC](https://forum.inductiveautomation.com/t/session-events-in-designer-startup-not-running/112352 "2025-11-21T08:29:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![willemghys2000](https://avatars.discourse-cdn.com/v4/letter/w/da6949/32.png) [@willemghys2000](https://forum.inductiveautomation.com/u/willemghys2000)\
**Post date:** [November 21, 2025, 8:29am UTC](https://forum.inductiveautomation.com/t/session-events-in-designer-startup-not-running/112352/1 "2025-11-21T08:29:46Z")

</div>

Hi,  
So I try to make a startup session event, but every time I start my project it doesn’t run and it has a compiling error. In my perspective session property editor I have a custom value called operatorBlock and sometimes it just disappears. I try to make a session event on startup to generate this value, but I can’t really get it to work.

Anyone got some advice?

```python
def onStartup(session):
session.props.locale = "en-US"	
print("Locale (Language) is in English now (en-US)")

if 'operatorBlock' in session.custom:
		operatorBlock = session.custom.operatorBlock
		print(operatorBlock)
else:
	session.custom.operatorBlock = "OperatorStartUp"

```

---

<div class="post-metadata">

**Author:** ![JVDM](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@JVDM](https://forum.inductiveautomation.com/u/JVDM)\
**Post date:** [November 21, 2025, 9:50am UTC](https://forum.inductiveautomation.com/t/session-events-in-designer-startup-not-running/112352/2 "2025-11-21T09:50:01Z")

</div>

Is this an exact copy of the working version of the code? If so, be sure to indent your code correctly:

```python
def onStartup(session):
    session.props.locale = "en-US"	
    print("Locale (Language) is in English now (en-US)")

    if 'operatorBlock' in session.custom:
    		operatorBlock = session.custom.operatorBlock
		    print(operatorBlock)
    else:
	    session.custom.operatorBlock = "OperatorStartUp"

```

If this still doesn’t work, try:

```python
self.session.props.locale

```

Could you try adding a logger and seeing if this script runs at all?

[system.util.getLogger | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-getLogger)

---

<div class="post-metadata">

**Author:** ![tgarrison](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tgarrison/32/80965_2.png) [@tgarrison](https://forum.inductiveautomation.com/u/tgarrison)\
**Post date:** [November 21, 2025, 1:54pm UTC](https://forum.inductiveautomation.com/t/session-events-in-designer-startup-not-running/112352/3 "2025-11-21T13:54:28Z")

</div>

Still not indented correctly. The indent on the if is 2 tabs instead of just the proper 1. The if and else indents should line up...

---

<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:** [November 21, 2025, 4:45pm UTC](https://forum.inductiveautomation.com/t/session-events-in-designer-startup-not-running/112352/4 "2025-11-21T16:45:02Z")

</div>

> [@willemghys2000](#):
>
> Anyone got some advice?

Stop asking LLMs for help with Ignition.

Here's your code rewritten to use tabs for indents consistently (while either spaces or tabs will work within Ignition's context, the built in editor uses tabs and you must be consistent to ensure no weird behaviors in Jython 2).

Separately, `print` is a **statement** , not a **function** , in Python 2.7 syntax, a detail LLMs perenially get wrong when you just ask them for "Python code to do X". But in any event `print` is not useful to you from a Perspective script; it will [print to the wrapper log](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/script-logging-print-statement-output#gateway-execution), not anywhere you can easily see. Use `system.perspective.print` instead.

```python
def onStartup(session):
	session.props.locale = "en-US"  
	system.perspective.print("Locale (Language) is in English now (en-US)")

	if 'operatorBlock' in session.custom:
		operatorBlock = session.custom.operatorBlock
		system.perspective.print(operatorBlock)
	else:
		session.custom.operatorBlock = "OperatorStartUp"

```

---

<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:** [November 21, 2025, 4:49pm UTC](https://forum.inductiveautomation.com/t/session-events-in-designer-startup-not-running/112352/5 "2025-11-21T16:49:12Z")

</div>

> [@paul-griffith](#):
>
> Stop asking LLMs for help with Ignition.

Also note this [forum's rule](https://forum.inductiveautomation.com/faq) on letting us know when you are showing us LLM output.

As an IA employee, Paul can't fully express how annoying this is.

As a forum regular, let me tell you: this is **super annoying**.

Just don't use LLM's with Ignition. At least until you already know how to use Ignition.
