[mod edit - after quite a few posts it became apparent that this was being tested on iOS companion]
I'm quite new to App Inventor and would like to create a search bar that would allow a user to search for, say a keyword, and would like them to be able to view the definition. The keyword and definitions are stored in an external database on Google Sheets and I would like the program to retrieve the data from there.
The problem is essentially this: When you search the list using the filter bar and click the first option, the definition that is displayed is from the first index on Google Sheets.
I don't know how to change this code and need help!!!
I've added some images of my code and would like to know how I can change the "ListView1. After Picking" so that it shows the definition that I want. I've also added a video of how the code works when executed so that you can identify the problem.
Why do you need two screens for this? Just use the visibility feature of vertical arrangements and run all this one Screen1, then you don't have to worry about data transfers between screens, not switching screens correctly etc, etc, etc....
If you filter a listview, it returns a shorter list (based upon the filter) with a new index. You will need to do a comparison of the selection with the contents of the original list you fetched from google sheets.
On testing, it looks like MIT have fixed this issue, because it is returning the same index. I must have been asleep when this happened! You therefore should not have to worry about different indexes when filtering a listview.
Your problem is that you set the list elements before you have read the data. move the set list elements block to the end of the read data procedure.
For me when I select an item from a list after using a filter bar, (like "expand"), it shows me the definition for "factorise" and I don't know why. Do you think it has to do something with the way I have my Google Sheet database structured?
So if I like searched up "variable" on the filter bar and clicked on it if it appeared first, it still shows the definition for factorise for some reason.