Can dictionary handle mutidimensional JSON arrays?

Hi!

I have an incoming data in multi-dimensional (2D) JSON format like:
{"XY" : [[1,2,3],[4,5,6],[7,8,9][0,0,0]]}.
Unfortunately i cant use the web.get JSONtextdecode because it is arrive by GET request, it is coming on a Websocket extension. Maybe i will suggest for a later update that the JSONtextdecode separation not only work on web.get blocks.
Can a dictionary handle it? I tried to apply it by key, but when i looking for the key, it says not found.
2djson
This is the way i tried it.
Can it be done simply like this, or i have to use some for-each thing, or the dictionary cant handle multidimensional anyway?

There is no reason why you should not be able to use JsonTextDecodeWithDictionaries. Just drag the component and attach the JSON text string to it.
But, you have two problems:
Your string is not valid JSON, it is missing a comma, this is the right one:
{"XY" : [[1,2,3],[4,5,6],[7,8,9],[0,0,0]]} .
And of course, when you say set global data to get message, it becomes a string, not a dictionary.
This will work:



Try it!

1 Like

Hmm. And yes. It works. Thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.