# Popup Parameters: Array param converts to value

**URL:** <https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [September 19, 2022, 9:17pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251 "2022-09-19T21:17:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 19, 2022, 9:17pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251/1 "2022-09-19T21:17:11Z")

</div>

I have a popup with a parameter that I’ve set to type array. When I use `system.perspective.openPopup()` and pass an array to that parameter, it breaks my bindings because it converts the param to a value instead of array.

If I copy and paste the generated array to the parameter on the view in the designer it changes it back to array type and fixes the window.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 19, 2022, 10:12pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251/2 "2022-09-19T22:12:41Z")

</div>

Gonna need a bit more info. What’s your calling script that’s opening the popup?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 19, 2022, 10:21pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251/3 "2022-09-19T22:21:56Z")

</div>

I don’t have the script handy atm, but it’s a named query result converted to the json array format.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 19, 2022, 10:23pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251/4 "2022-09-19T22:23:39Z")

</div>

> [@dkhayes117](#):
>
> json array format

You're not using `system.util.jsonEncode` are you? This converts python objects into a string.  
You should just be passing in your param as a python list

e.g.

```python
ds = system.db.runNamedQuery(...)
data = [ds.getValueAt(i,0) for i in range(ds.getRowCount())]
params = {'data': data}
system.perspective.openPopup('id', 'view', params=params)

```

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 19, 2022, 10:27pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251/5 "2022-09-19T22:27:45Z")

</div>

No. As I said, the converted result is valid when copy and pasting it to the view param. When called as a parameter value to pass with `openPopup` the view param converts itself to value instead of array.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 19, 2022, 10:31pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251/6 "2022-09-19T22:31:25Z")

</div>

Well… Now I can’t remember if I used `encodeJSON`. I’ll check tomorrow, thx!

Very well could be an ID 10 T error

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 20, 2022, 12:06pm UTC](https://forum.inductiveautomation.com/t/popup-parameters-array-param-converts-to-value/64251/7 "2022-09-20T12:06:17Z")

</div>

> [@nminchin](#):
>
> You’re not using `system.util.jsonEncode` are you?

Ack, yep you were right. I didn't think I was using that, but I was. Got it fixed and working now.
