# Ignition props interprets script return wrongly

**URL:** <https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [March 14, 2024, 2:35pm UTC](https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337 "2024-03-14T14:35:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Leech](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex_leech/32/39391_2.png) [@Alex\_Leech](https://forum.inductiveautomation.com/u/Alex_Leech)\
**Post date:** [March 14, 2024, 2:35pm UTC](https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337/1 "2024-03-14T14:35:04Z")

</div>

Hi all,

Little unsure how to search for an answer for this!

I've got a property binding that I want to return an array of objects (esentially a dataset... but I want it in JSON form, not a dataset)  
The script returns the correct structure, but ignition puts it as a string.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad27a613d7b73f3205b803e981cae0bc696fb6e7.png)

If I copy and paste the data, it formats it correctly  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8ba20853a6cd5345bac9446c0ec0799c60b98fd5.png)

How do I ask ignition nicely to recognise the structure? (Noted the array length changes)

Binding is as follows:

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

Thanks!  
😃

---

<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:** [March 14, 2024, 2:39pm UTC](https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337/2 "2024-03-14T14:39:05Z")

</div>

Don't use `json.dumps`. That's what is creating the string. Just return the jython list of jython dictionaries. Perspective will accept that as an array of objects.

---

<div class="post-metadata">

**Author:** ![Alex\_Leech](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex_leech/32/39391_2.png) [@Alex\_Leech](https://forum.inductiveautomation.com/u/Alex_Leech)\
**Post date:** [March 14, 2024, 2:42pm UTC](https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337/3 "2024-03-14T14:42:33Z")

</div>

Could have sworn I tried that earlier ... Home time I think!  
Thanks @pturmel ! ☺

---

<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:** [March 14, 2024, 2:45pm UTC](https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337/4 "2024-03-14T14:45:58Z")

</div>

You might also like my Integration Toolkit's solution:

```auto
forEach(
	{this.custom.selectedCylinderIds},
	it()
)

```

Just an expression binding, no transform, no jython overhead.

---

<div class="post-metadata">

**Author:** ![Alex\_Leech](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex_leech/32/39391_2.png) [@Alex\_Leech](https://forum.inductiveautomation.com/u/Alex_Leech)\
**Post date:** [March 14, 2024, 2:52pm UTC](https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337/5 "2024-03-14T14:52:17Z")

</div>

Thats super useful to know thanks!  
I've just installed the Integration Toolkit yesterday, but havent yet fully got to grips with how I use all the functions! Need to have a detailed read of the docs with a coffee.

I wont derail this thread too far, but I was trying to work out how to call a script that passes an array into it as a parameter. Then do this conversion on the output. The screenshot in my original post has a 'value' parameter of [1,4,6] or [2,4,7,8,9] etc

---

<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:** [March 14, 2024, 3:07pm UTC](https://forum.inductiveautomation.com/t/ignition-props-interprets-script-return-wrongly/87337/6 "2024-03-14T15:07:26Z")

</div>

Oh, I see. That would be an inner join. Also part of my Integration toolkit. (Could also be done with `asMap()` and `where()`.)
