Upload the JSON as a text file here, if you want a working sample.
I would use a YAML format, one item from the list at key "items" per Element.
The Elements would be rather large, though.
Start by running the JSON through the Web component's DecodeJSONAsDictionaries block to get a dictionary in a global variable.
Extract the list at the value of key "items".
It will be a list of dictionaries, 892 items long.
Loop through the list, feeding each dict into this YAML converter, and adding the resulting texts to the ListView Elements list.
(draggable)
There is an advanced list block that can transform one list into another list in a single block.
Thanks for the help! I'm fetching the JSON File from the google books API so its different depending on the query but thats the whole JSON based on the query mobydick:
books.json (47.2 KB)
I want to display the book title and the author in the ListView and when i select a book in the list view another window would open with more informations.
This is how the listview would look.
This is how the page with the book's information would look. (Figma prototype)
Here's the ListView part:
Google_books_API_JSON (1).aia (11.3 KB)
You can use the ListView SelectionIndex to get you to the selected book dictionary in the books list, and do the dictionary lookups into your detail Vertical Arrangement.
No need for multiple Screens here, just make the ListView invisible after the Selection.
Thank you so much Abraham, I'll give a try on the solution you gave on the book details. Wanted to say that you helped me a lot! I'm working on this project for a competition here in Brazil, and I'm hoping we can secure a victory.
Sorry for bothering, but would you mind sharing an example on how you would code this solution? I'm having some trouble doing it and it would help me a lot. I tried creating another list but i'm stuck on where i should go next. I already created the VerticalArrangement and the elements inside of it.
Export and post the .aia with the Arrangement and Labels for the selected book.
BTW, I only know English.
AmigoLivro (1).aia (5.2 MB)
The search page is in the "MeusLivros" screen. Feel free on giving advice if you see anything we can improve.
Hi @AmigoLivro,
I already developed an extension to read ebook and the sample project show the json result in a listview as You want.
Here the link if You want to try
Best Regards
Marco Perrone
Your app is 95% glitz and 5% content.
Don't fall in love with extensions that make the app pretty at the expense of making it deliver value.
Cowboys call that "All hat and no cattle".
Here are the blocks to extract content from a selected book:
Google_books_API_JSON (1).aia (13.7 KB)
Thanks for the feedback. I know the app has a lot of cosmetic extensions but I had to use them so I could get an app that looked somewhat like our figma prototype, since the native customization options on AppInventor are quite limited.
The app is supposed to be a platform where people can trade books, so every user will have a list of books they already have and another list of books they want. Our original plan was for the user to be able to send out trade solicitations to other users, but I found out that AppInventor doesn't support push notifications so i don't think that's valid anymore. Another possible solution is to make a chat tab, but I'm still looking into it.
Thanks Marco, I'll take a look at it.