Hello there, So I have a program where I select an appointment info and click on an edit button where it'll direct me to an edit page. The thing is, the info in the listview is correct but the value then shown in the edit page is wrong. I now know that it is directly selecting the index of selection which is 2 where it'll pull the second rows data from my google sheet but it is not the data that I need. How do I fix this?
Now upon clicking the appointment on the 11th at 8am, then clicking the edit appointment button, it'll direct to the edit page with wrong data where it pulls the second row's data instead of the one I need:
You do seem to be getting the data correctly from your google sheet, but when requesting to edit an appointment where there is more than one appointment per patient, the iteration to select, after picking, is returning the first entry, because the search is by name value.
You need to iterate over the list using indexes as opposed to the name value.
But when I tried updating the data just to see if the data updated is going to the correct name, It actually does as told. It's just the data being shown in the edit page that is wrong.
how do I do so by using indexes? i'm still quite new and don't understand much. I only have basic knowledge of coding
You will see that for the first listpicker, regardless of the the "Jane" you select, it always returns the first entry in the list, whereas in the second listpicker, by using indexes, it returns the correct entry in the list.
I tried to implement using this method but the difference between yours and mine is that my list has already been filtered and will only show all the possible data that associates with the same name. So it will still show the same wrong output as before. I'm not sure how to extract the number of index of where the data was extracted from in my sheet when displaying in the appointment listview so that then I can use the said numbered index to show the right data in the edit page...
The screen you need to look for is the database screen and the block codes that you'll need to look for are on the far top right (read records to be extracted for edit page) and far bottom middle (list view for appointments for the specific resident)