How do I update an item in a list in list?

Hi all,

I created a list in list (so I can understand data update/entry in a DB style table structure with rows and columns).
I can add new row, but I am trying to figure out how I can update data in specific column.

Here's how my list in list look, this one has 3 rows and 2 columns.
1

I wanted to update 3rd row, 2nd column (the age of Oliver), my code reads the update from textbox1 and textbox2 and the following shows the outcome.

This is my blocks
3

For example, in SQL, we can specifically update a column via the following script:
update age set age = "13" where name = "Oliver";

and that will specifically update the column age

Thanks all,

How about using a Dictionary instead?
You can store the changeable age to the value, while setting the name to a fixed key.

You can update the value using this block:
image

The ploblem in your code is that you have a list of lists so selection index gives you
(Oliver 45) and in that list index for 45 is 2 . Using dictionaries is a good idea but here is how you can do it

2 Likes

@Mr_Hope here see this it works 100%

Video:-

Blocks:-

Aia:-

:file_folder:List_Edit.aia (3.0 KB)

It's very tacky; @dora_paz's method is way more reliable. Also, since we have no idea what OP is trying to achieve, it's better not to jump to conclusions.

Thanks @dora_paz that's it. I got the idea now from your illustration now.

1 Like

thanks @NishyanthKumar I didn't know about dictionary before, will look into it. thanks for your help!

1 Like

Thanks for the effort showing it! @Jinx!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.