Selection Index Error

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?

this is my table sheet:

Here is the appointment listview in the bottom where it shows the correct data:

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:

here are my block codes for it:

how and where do you pull that data from the table?

Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

I use a google script for it and here is the code to read a single record after chosen:

And where the appointment listview gets its data from is from this block code:

where I use a google script code to the read all the data but then filter it to only show what data I need from a specific resident:

you could try this approach to read a single record


The thing is everytime I open puravida, I can't see a thing. The background and images are all

the correct link for my webpage is
there are othere sites, who copied my content, and those display these images...


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

After clicking on the link it still displays the same images. It's quite hard to read...

Here is a simple aia project example
usingIndexes.aia (3.5 KB)

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...

Can you share your current project aia ? You can private message it to me if you do not want it on the public forum.

ECMS.aia (2.2 MB)

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)

I will take a look, I only have @ 1/2 an hour before I have to duck out!

that's okay, I take your time. We still have tomorrow

Hello gentlemen, did you manage to solve the problem because I am struggling with a similar one.