If you have carriage returns int he view data then the JSON is broken.
We worked around this by using the formula below
@replacesubstring(somefieldname;@newline;““)
Otherwise a nice bit of code. I would love to look at it more and understand if the tree could be cached in some way.
Thanks for submitting it to OpenNTF
Sean