Hi guys, sorry for the unclear title but I do not know what name to put or what to Google - I can only try my best to describe the situation. Sorry about this and please bear with me guys, thanks!
So basically, I have a google spreadsheet as my database. When I initialize my screen, my list view will show me all the elements of this spreadsheet.
When I do a listview.afterpicking, the next screen should show me all the relevant information pertaining to the element that I picked from listview. For example, if I pick the 2nd element (Index 2) in the screenshot above (Primary 2, Chemistry, East, S$60 - 70 per hour), it SHOULD bring me to this screen:
For example, let's say I search for the same job (Index 2) - Primary 2, Chemistry, East:
Ideally, it should bring me to the screen for Index 2. However, because after the search criteria, this job (which is index 2 in the initial listview has now become Index 1 in the new listview. The new screen then shows me the info for Index 1 instead of the ideally index 2.
The issue is due to the filtering of the listview (the listview elements that are filtered each attain a new index) - you will need to use the same filter (do this in afterPicking with the listview.Selection) to find the correct data. There are many ways to handle this.
you can avoid problems when switching screens and passing information by using virtual screens * Building Apps with Many Screens
if you insist on using real Screens, you have to pass the data to the newly reopened screens. Using StartValue is not a particularly efficient way... use a TinyDB to store and pass the List perhaps
Your app is complex. A way to test for problems is to build small modules as separate Projects. Get those Projects to work (like switching screen experiments); then put them together.
You used 'list from csv row text' - however, when I used it, I got an error. Is it because in my google spreadsheet, each of my rows have multiple cells while each of the row you used in your example (a,b,c,d,e,....) has only one "cell" per row?
Was wondering why is my list from csv table not working?
When I use list from csv row PLUS a pseudo csv file (Index2), and when I click on each element displayed in the listview, my Empty1.Text do say index of each element is 1, 2, 3, 4, etc.
However, when I use list from csv table PLUS my google spreadsheet file (responseContent), and when I click on each element displayed in the listview, my Empty1.Text shows that all my elements have an index of 0.
The issue with filtering and selection index was never really resolved. My method works for a simple list, but for a list of lists, we would need to rebuild the listview.Selection output back into an AI2 list format for it to match items in the main list...ugh!
Google Sheets can add a unique row number to each row, to help identifying rows by cell value. Insert a column A with value =ROWID() to get the unique identifiers.
Once you have the row ID of a desired row, you can go back and ask for just that row from Sheets using their SQL query URLs.
You can call it a job ID in your app, if you like.