# Is it possible to pass variable from gateway scope to client scope?

**URL:** <https://forum.inductiveautomation.com/t/is-it-possible-to-pass-variable-from-gateway-scope-to-client-scope/45008>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [March 29, 2021, 12:00pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-pass-variable-from-gateway-scope-to-client-scope/45008 "2021-03-29T12:00:24Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [April 1, 2021, 3:36pm UTC](https://forum.inductiveautomation.com/t/is-it-possible-to-pass-variable-from-gateway-scope-to-client-scope/45008/21 "2021-04-01T15:36:11Z")

</div>

> [@nminchin](#):
>
> I tried jsonEncode to write to a tag and I got a max recursion level reached error

One of the datatypes somewhere in the structure you're passing into jsonEncode is more than likely not a real dict/list type and jsonEncode barfs on them. There was a [recent forum discussion](http://forum.inductiveautomation.com/t/jsonencode-issue/44603) about this failure symptom.

This is a problem with [duck-typing](https://en.wikipedia.org/wiki/Duck_typing) languages in general. As I put it to my colleague, something in the structure can walk like a duck and quack like a duck, and has been passing as a duck for a very long time, but when I asked it to lay an egg it fell over and died.

---

_[View the full topic](https://forum.inductiveautomation.com/t/is-it-possible-to-pass-variable-from-gateway-scope-to-client-scope/45008)._
