Web Component json decode method changes the order of the JSON text

I just found that the Web JSON Decode Method will change the order of the origin JSON text. As a result, I have to check the keys every time which brings me a very big bloated code block.
Any ideas to fix it? Or I have always to check it by for i in range(xxx)?
For instance (it's worth to mention that both pictures are not describing the same JSON text):

(The JSON text for the first picture: the code block):
{"_text":"vertretung 9e heute","entities":{"GetInfo":[{"confidence":1,"value":"Vertretungsplan","type":"value"}],"GetClass":[{"suggested":true,"confidence":0.98500467313389,"value":"9e","type":"value"}],"datetime":[{"confidence":0.95622,"values":[{"value":"2020-01-30T00:00:00.000+01:00","grain":"day","type":"value"}],"value":"2020-01-30T00:00:00.000+01:00","grain":"day","type":"value"}]},"msg_id":"1lKBUXenoI8W9XCQf"}

An example of the changed order.

the order of the keys should never be relevant...
to get a key value pair, use the loopup in pairs block
How does the lookup in pairs block work?


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Note that in the next release there will be support for JSON dictionaries in App Inventor. I haven’t checked it, but it may be better at keeping order. However, there’s no guarantee to maintain key order as @Taifun stated.

ok, get it, thanks.
I just thought it is too hard to find the key:value by JSON text if it is structured as such list in App Inventor

And also thanks for the answer from @Taifun .

Whilst I agree with what is said by @Taifun and @ewpatton, see HERE a workaround created a couple of years ago for simple json to maintain order!

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