# \[BUG\] Json encode function break the runNamedQuery

**URL:** <https://forum.inductiveautomation.com/t/bug-json-encode-function-break-the-runnamedquery/91724>\
**Category:** Ignition\
**Tags:** scripting, database, perspective\
**Created:** [June 12, 2024, 7:51am UTC](https://forum.inductiveautomation.com/t/bug-json-encode-function-break-the-runnamedquery/91724 "2024-06-12T07:51:56Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [June 12, 2024, 1:58pm UTC](https://forum.inductiveautomation.com/t/bug-json-encode-function-break-the-runnamedquery/91724/4 "2024-06-12T13:58:25Z")

</div>

huh try

```python
params = dict(self.parent.custom.ResultControle)

```

seems like if you have a nested dict you might also have to do this instead

> [@Function to convert json string or python dict into ObjectWrapper](https://forum.inductiveautomation.com/t/function-to-convert-json-string-or-python-dict-into-objectwrapper/32861/16):
>
> Forcing each to the expected type while traversing makes a deep copy: def sanitize\_tree(element): if hasattr(element, '\_\_iter\_\_'): if hasattr(element, 'keys'): return dict((k, sanitize\_tree(element[k])) for k in element.keys()) else: return list(sanitize\_tree(x) for x in element) return element EDIT: Got rid of the unnecessary zip() and used only one keys() iterator instead of two.

---

_[View the full topic](https://forum.inductiveautomation.com/t/bug-json-encode-function-break-the-runnamedquery/91724)._
