Error Select list item: Attempt to get item number

Not really :wink:

What is the data you are saving and why are you saving it ? - just explain what you are doing....

What is the difference between case 1 and case 2 ?
What type of data is entered in "Column 3" (give examples) ?
What type of data is entered in "Column 4" ( I understand this will be a number/integer )?

In your blocks, you are saving the value of a label to your list as well, what data is this, where is it shown ?

Why do you need to add up everything in "Column 4" ? What will you do with this value ?

Can you confirm that your four listviews are just for the display of information held in the tinydb (and for selection to allow for a record to be deleted) ?

What else will happen with this data. What parts of the app have you not yet told us about ?

Why do you need another screen ? This can all be handled on one screen....

As I previously asked, explain in more detail......

The checkbox 1 and 2 are two choices and just their labels are in the second column.
The column 3 is just text without restriction.
The column 4 is, effectly, just numbers and this is why we can't add everything in a one column.
The tinydb is for save data when the user return to the screen and for save the sum of numbers from column 4.
Like explained, the idea is to duplicate this screen and list all total entries in an indepedant screen like summary.

Why ? you already have the tinydb outputted to a set of listviews.... you could hide some parts of the existing screen to just show this....

You could use a switch component to select between case 1 and 2.
You probably need to display the date once selected (this helps to confirm it has been done, or you could display the current date if that is what is needed to reduce user input)

It would really help to understand what you are doing, this would make it much easier to provide a solution.

What are the texts in column 3 ? What are the numbers in Column 4 ? Are they repeatable items - could their selections also be in lists for the user to pick from ?

I don't have problems with the forms, in aia file, you can see they are built but I don't find how list them in columns, like a csv, save them in tinydb and do the sum of the column 4 values.

The summary screen is here to list all sums in a one screen like statistic page.

Try this:

AIA

FourColsTDB.aia (9.5 KB)

BLOCKS

SCREENS

2 Likes

Thanks I see if I understand all of that but it's very cool your answers for my project.

When I test in companion, I have a message from a previous test : Select list item: Attempt to get item number 3 of a list of length 2: ["test", "1209"]

Do you know why, there is a cache ?

You need to empty your tinydb from the companion. Drag out the ClearTag block and set it to columnList, right click and Do It.

Thanks It's good and your switch idea is a good alternative to my checkbox choice.

It stay me my wish to call the sum in a summary screen.

How can I do to sum only the column 2 only when the case 1 is selected?

I test this but it's not good

I did ask......

You can use a procedure like this, just set the case you want.

Sorry, I have forgotten this point.

All works but the sum only need to take the column 2 numbers when the switch is on case 1.

I know my test "label6 textecolor = red" isn't good and I test "If switch1 .on" but it's not good too

I don't find the + block

The + block is in the math blocks section.

You can right click it to switch between inline and external sockets.

Thanks, I found it.

Where I can put the call sumCase block?

In the setListviewElements procedure do this:

image

1 Like

Very good and thanks for your help.

Question, if I duplicate this screen the tinydb use the namespace or whatever where I add tinydb it's always the same ?

1 Like

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