# Session property array change type

**URL:** <https://forum.inductiveautomation.com/t/session-property-array-change-type/115310>\
**Category:** Ignition\
**Created:** [April 29, 2026, 5:23pm UTC](https://forum.inductiveautomation.com/t/session-property-array-change-type/115310 "2026-04-29T17:23:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken.maze](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken.maze/32/85876_2.png) [@ken.maze](https://forum.inductiveautomation.com/u/ken.maze)\
**Post date:** [April 29, 2026, 5:23pm UTC](https://forum.inductiveautomation.com/t/session-property-array-change-type/115310/1 "2026-04-29T17:23:33Z")

</div>

I am storing a list of long elements in a session.props.custom. I make the whole list then store it in the property.

When I check the type of the elements just after, the elements are unicode. Is this expected behavior? I just wanted to be sure so I can know it will always be unicode instead of long or whatever.

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:** [April 29, 2026, 5:51pm UTC](https://forum.inductiveautomation.com/t/session-property-array-change-type/115310/2 "2026-04-29T17:51:18Z")

</div>

The type of the elements will depend on how they're populated. Perspective's property model is ultimately backed by JSON, so elements can be numbers, strings, booleans, or nulls. Those properties then get mapped to Jython types when you read them in scripts, and unicode is the string type used.

---

<div class="post-metadata">

**Author:** ![ken.maze](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken.maze/32/85876_2.png) [@ken.maze](https://forum.inductiveautomation.com/u/ken.maze)\
**Post date:** [April 29, 2026, 6:01pm UTC](https://forum.inductiveautomation.com/t/session-property-array-change-type/115310/3 "2026-04-29T18:01:18Z")

</div>

These were populated with longs, so you're saying that JSON doesn't support longs therefore it casts it to unicode?

---

<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:** [April 29, 2026, 6:46pm UTC](https://forum.inductiveautomation.com/t/session-property-array-change-type/115310/4 "2026-04-29T18:46:00Z")

</div>

No. I'm saying you need to provide more details on what "populated with longs" means to you.

Given one button:

```python
def runAction(self, event):
	self.view.custom.test = [
		"1",
		1,
		long(1),
		1.0,
		True
	]

```

You get the following:

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

Perhaps misleadingly, if you run this without saving:

```python
def runAction(self, event):
	for p in self.view.custom.test:
		system.perspective.print("%s - %s" % (repr(p), type(p)))

```

Type information appears to be preserved:

```python
11:43:14.112 INFO -- u'1' - <type 'unicode'>
11:43:14.112 INFO -- 1 - <type 'int'>
11:43:14.112 INFO -- 1L - <type 'long'>
11:43:14.112 INFO -- 1.0 - <type 'float'>
11:43:14.112 INFO -- True - <type 'bool'>
11:43:14.112 [Browser Thread: 17eb01f7-0d4f-4fc8-b887-21de0a965dbf] INFO Perspective.Designer.Workspace -- True - <type 'bool'>

```

But then if you save and reopen the view:

```python
11:43:58.816 INFO -- u'1' - <type 'unicode'>
11:43:58.816 INFO -- 1L - <type 'long'>
11:43:58.816 INFO -- 1L - <type 'long'>
11:43:58.816 INFO -- 1L - <type 'long'>
11:43:58.816 INFO -- True - <type 'bool'>

```

---

<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:** [April 29, 2026, 7:17pm UTC](https://forum.inductiveautomation.com/t/session-property-array-change-type/115310/5 "2026-04-29T19:17:47Z")

</div>

Be aware that if you stick an object that **isn't** a Perspective-compatible type, then it will be **stringified** and no longer be an object.

If you need to preserve original objects associated with views/pages/sessions, you need my Integration Toolkit's `viewVarMap()`, `pageVarMap()`, and/or `sessionVarMap()` functions.
