Hi All,
I have read a bunch of docs and other community articles today but I am finding a task (that I think should be simple) very frustrating! I am trying to get the results of an API into a listviewer to form a list of clickable links that will go to another page and use the relevant ID to load data from another API.
JSON response is as follows
[{“key”:“1”,“value”:“Jindabyne”},{“key”:“2”,“value”:“Cooma”},{“key”:“3”,“value”:“Berridale”},{“key”:“4”,“value”:“Bombala”},{“key”:“5”,“value”:“Adaminaby”},{“key”:“6”,“value”:“Anglers Reach”},{“key”:“7”,“value”:“Dalgety”},{“key”:“8”,“value”:“Michelago”},{“key”:“9”,“value”:“Delegate”},{“key”:“10”,“value”:“Bredbo”},{“key”:“11”,“value”:“Numeralla”},{“key”:“12”,“value”:“Nimmitabel”},{“key”:“13”,“value”:“Jerangle”},{“key”:“14”,“value”:“Craigie”},{“key”:“15”,“value”:“Charlottes Pass”},{“key”:“16”,“value”:“Thredbo”},{“key”:“17”,“value”:“Perisher”},{“key”:“18”,“value”:“Guthega”},{“key”:“19”,“value”:“Mt Selwyn”}]
This is what I have in the blocks.
So I think what is happening is:
When Screen 1 starts
Load data from the API URL
Set my variable ListContents to empty list
Then from the JSON object, insert the ‘name’ key into the list
Set the contents of the List Viewer to the variable ListContents
However all I get is a blank row in the list viewer. Where am I going wrong?
Secondly when the user clicks one of these items (once populated) how do I use the key (integer) with the button and pass it to the next screen?
Thanks!