I want to use this block (from AI2) in Kodular. Although the method of Peter (the above link) worked sometimes, but when it faced array, it is completely wrong.
Check this topic for more information:
I want to use this block (from AI2) in Kodular. Although the method of Peter (the above link) worked sometimes, but when it faced array, it is completely wrong.
Check this topic for more information:
Hi @WatermelonIce…Until kodular adds this block to the web component, I created this extension that parses json to dictionary like the block in app inventor…
Please test if it works …
(of course this extension is only for those who wants to use the json text decode with dictionaries block while it doesn’t exist in kodular…And not a new something so i posted here and not in a new thread) :
That’s an example:
With app inventor:
{
"names": [
{
"name": "Peter",
"age": 30
},
{
"name": "John",
"age": 27
},
{
"name": "Luke",
"age": 34
}
]
}
Hope it helps you…
EDIT:Reduced the aix size from 99.7 kb to 6.4 kb
That happened by removing unused third party library…
Edit: rewritten the extension and released it in a new topic:
Wow, let me tried it out
Hope it works
It worked perfectly, and you can publish this extension. Just out of curiosity, will you provide the code too?
Great
I don’t know should i publish this extension or no…As it’s already present in app inventor and of course it will be added in kodular…But of course i can provide the extension java code…
how can read text from direct .json file from, not from json text ?please help !
You must retrieve text from this json file ( i don’t where it is ) and then use the parseJsonWithDictionaries to parse it
You can use the File component to read .json yext and use the extension
Use Json Decode block from Web component.
It will convert text to lists.
Use list to dictionary block from dictionary blocks.
This method may not return the right result: