Hello, I have a problem with the visualization of the data … I do a simple reading of the mysql database, but the data in the listview is not visluazzati correctly … there is some problem with json and php: where am I wrong?
When you decode JSON text, the output is a list or dictionary structure that you can feed into a lookup in pairs block or a dict block to lookup by tag.
Using text replace on list or dict structures completely misses the point of having the name:value pairs.
See FAQ Section: JSON and Dictionaries
Inanzitutto grazie per la risposta. Sono alle prime armi con app inventor.
Quindi se ho capito bene devo usare combinazione del blocco JsonTextDecode del componente Web e dei blocchi elenco è possibile accedere a qualsiasi record di dati di immissione e valore tag?
Se è così, quale blocco dovrei modificare?
First of all thanks for the reply. I am a beginner with app inventor.
So if I understand correctly I have to use a combination of the block JsonTextDecode of the Web component and block list, you can access any data record input tag value?
If so, what block should I change?
Here’s the raw Json you receive (from a Do It, so extra quotes) …
“{“users”:[{“name”:“Luca”,“email”:“prova@tin.it”,“address”:“viale san giuseppe”},{“name”:“Dona”,“email”:“dona@hotmail.it”,“address”:“Regione Muda”}]}”
It’s a JSON text of an object, single attribute (tag = “users”, value = list of user objects.)
If you want to retrieve values from a ListView selection to populate Labels, use the .SelectionIndex and look up the values by index in global users, then by tag name in the selected user item.
Great, it works !!
One more question: if I wanted to click on a data (for example the name), would it be better to stay on the Listview or is it better a text or button field?