# Passing a list into runScript() expression binding

**URL:** <https://forum.inductiveautomation.com/t/passing-a-list-into-runscript-expression-binding/106125>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 10, 2025, 2:07pm UTC](https://forum.inductiveautomation.com/t/passing-a-list-into-runscript-expression-binding/106125 "2025-05-10T14:07:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [May 10, 2025, 4:01pm UTC](https://forum.inductiveautomation.com/t/passing-a-list-into-runscript-expression-binding/106125/5 "2025-05-10T16:01:36Z")

</div>

Type hints are wrong (this is an old version in my clipboard history) but code usually works. Sometimes GSON can’t handle nested types. I think Phil’s module has a method to do this as well, but assume you’re not using it in this case

```python
	@staticmethod
	def unWrap(wrappedObj): # type: (WrappedObject | Sequence[WrappedObject]) -> UnwrappedObject | Sequence[UnwrappedObject]
		"""Unwraps Objects to dict - Used for finnicky JSON encoding and message handlers
			Example: `_system.util.unWrap(self.view.params)`

		Args:
			wrappedObj: WrappedObject | Sequence[WrappedObject]

		Returns:
			dict: UnwrappedObject | Sequence[UnwrappedObject]
		"""		
		# return dict(wrappedObj) # shallow dict, sendRequest doesn't like
		# return system.util.jsonDecode(system.util.jsonEncode(wrappedObj)) # chokes (weird types/depth limitations)
		# import json
		# return json.loads(json.dumps(wrappedObj)) # # chokes (weird types/depth limitations)
		# https://forum.inductiveautomation.com/t/function-to-convert-json-string-or-python-dict-into-objectwrapper/32861/15
		from com.inductiveautomation.ignition.common import TypeUtilities
		return TypeUtilities.gsonToPy(TypeUtilities.pyToGson(wrappedObj))

```

Related: [Curiosity: why are documented methods throwing AttributeError (is my ignorance showing?) - #14 by hunterdg](https://forum.inductiveautomation.com/t/curiosity-why-are-documented-methods-throwing-attributeerror-is-my-ignorance-showing/85081/14)

---

_[View the full topic](https://forum.inductiveautomation.com/t/passing-a-list-into-runscript-expression-binding/106125)._
