Hey, I am Logan. I need some help establishing if this is intended or a bug…
In JSON, lets say you have a list variable. What is it’s structure?
[
item_1,
item_2,
item_3
]
That’s fine, now replace those items with key-value pairs. Now it’s a “list of pairs”.
[
(key_1, value_1),
(key_2, value_2),
(key_3, value_3)
]
Now, lets replace each of those values with dictionary.
[
(key_1, {}),
(key_2, {}),
(key_3, {})
]
In each of those dictionaries, lets add some key and values.
[
(key_1, {
"key_1_1" : "value_1_1",
"key_1_2" : "value_1_2"
}),
(key_2, {
"key_2_1" : "value_2_1",
"key_2_2" : "value_2_2"
}),
(key_3, {
"key_3_1" : "value_3_1",
"key_3_2" : "value_3_2"
})
]
Now, let us replace those values with lists.
[
(key_1, {
"key_1_1" : [ ],
"key_1_2" : [ ]
}),
(key_2, {
"key_2_1" : [ ],
"key_2_2" : [ ]
}),
(key_3, {
"key_3_1" : [ ],
"key_3_2" : [ ]
})
]
Now… Let’s stop here, because this is where I am having issues.
Everything up to this point formats correctly in Kodular. However, the last nested lists, if they were empty when the screen initializes and I was to add key-value pairs making it a paired-list, then I can use all the regular methods for “lists” in Kodular. I can lookup pairs, I can find by index or find the index of a pair, etc…
However… IF the lists had pairs inside them when the screen initalizes, the world ends. I can no longer use lookup pairs, or find the index or use an index because Kodular converts this list and all future lists to dictionaries…
I am posting due to the problems that it is causing with my app data structuring (nested lists, nested dictionaries and combinations). It is catastrophic and will require complete restructuring if this is an intended feature.
Like I said in my explaination, if the list is empty then it stays a “List” and nothing is effected if I add more nested pairs, lists, dictionaries, etc… But if it has anything in it (like when I recall a saved data), it breaks everything.
Can someone explain why this is happening? Or tell me if this is something that App Inventor or Kodular intended for.
Thank you for your time, and hopefully I explained things clearly/organized enough that my issue can be understood (and not sound like gibberish). If I need to clarify anything, then let me know.
– Logan (a.k.a. DarkComet)