if you are trying to write a general purpose routine for converting ANY json string tnto a list, which could contain another list as an item, etc, using thunkable - good luck!
while there is indeed a block for getting the variable names (what you call jsonId), there is no way -using thunkable - to determine what data class each item is (ie, string, integer, real, date?).
and the only way to determine if an item is a list, is to obtain the object then get its length - if greater than zero, it’s an array. and you have to be able to that recursively (ie.list of lists of lists of lists … etc).
i was able to convert your json example
{
"temperature": "+31 °C",
"wind": "4 km/h",
"description": "Sunny",
"forecast": [
{
"day": "1",
"temperature": "31 °C",
"wind": "7 km/h"
},
{
"day": "2",
"temperature": "+32 °C",
"wind": "20 km/h"
},
{
"day": "3",
"temperature": "+32 °C",
"wind": "19 km/h"
}
]
}
the same data above is minified into this string
{"temperature":"+31 °C","wind":"4 km/h","description":"Sunny","forecast":[{"day":"1","temperature":"31 °C","wind":"7 km/h"},{"day":"2","temperature":"+32 °C","wind":"20 km/h"},{"day":"3","temperature":"+32 °C","wind":"19 km/h"}]}
… into a list using this block:
… and it does its thing and it creates the list in variable rlist but if you display the list, it’s confusing because thunkable doesn’t use any symbol for indicating start or end of arrays.
while you’re expecting this, an array of 4 items where the 4th item is an array of 3 arrays!
[+31 °C,4 km/h,Sunny,[[1,31 °C,7 km/h],[2,+32 °C,20 km/h],[3,+32 °C,19 km/h]]]
you get this instead:
internally, thunkable knows where the items are but you wouldn’t be able to debug it visually because there are no clues where the array starts or end.
for example, this block segment
display the 2nd entry in the forecast array correctly.
you still have to parse it to get the individual parts of course.
here’s the version i played with:
https://x.thunkable.com/copy/8cfb764164ca7d99c79e38dfd9f80331
.