Popup Parameters: Array param converts to value

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.

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

I don’t have the script handy atm, but it’s a named query result converted to the 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


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)
1 Like

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.

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

Very well could be an ID 10 T error

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