I have listview that I created with a csv file, with 19 indexes (list1) and other list created with colin tree only with 3 indexes (list2).
Is possible for each element of list 1 if they are in list2 (in index2 of list2), replace each element for the text “yes”?
I have a list of countries that are selected and stored in tiny db (list 2 mentioned above) - see attach 1
and i’ve a wish list created thru a csv file (list 1 mentioned above) - see attach 2
step 1 and 2 are working ok!
if countries in list 1 (csv list) are in list 2 (tiny db list), i want to replace only these countries in the list created with csv file with the text “YES”
For example if my list 2 (stored in tiny db) has Australia, Canada, India i want to replace the values that are shown in the list view created thru csv list with “YES” - please see attach 3 -
I’m trying to understand how to apply these examples to my case, and i’m not sure how, because the layout is very different.
The first step that i needed your help to understand is how to find the “n” values stored in one tag in tinydb (selected country names) in another list that is already vertical, separated by \n (like suggested in the docs sent), etc … than identify by changing that text and keep the others like before.
example: before i’ve
Benjamin
Gold
Business
3
France
Spain Australia
(none)
(none)
…
because Australia is stored in tinydb, the new list should be:
Benjamin
Gold
Business
3
France
Spain YES
(none)
(none)
…
If you have not yet done so, search the web for articles like Introduction to SQL to learn how to think in sets of records and tables.
Instead of marking up your original data tables, think in terms of filtering out temporary tables matching your search criteria. It makes for easier solutions.
My issue, is that i dont want to filter or add a new list if the values are stored, like the examples sent before.
I want to keep the initial list - lookup for the values (countries) in csv list that are stored in tinydb - and replace them.
That is essential, because after i will like to count the number of “yes” for each name (key).
Probably i can do with the filter and than with the same key text do the sum of the count of each list.
Well first i’m going to do what you suggested, split my initial table, and try to lookup for a solution that gives me only the values stored in tinydb.
Please help taking into account my example.
It’s the first time that i really dont understand what is missing or what is the error, when i ask for forum help.
Because i already tryed all the suggestions, and i always get the same error. I need to understand what is the issue with probably the index.
Note - i just want to see the results in the list, i dont need to do a after selecting (list item)
The error is in the operation select list item … the format shown in the error message does not appear to be a List. This suggests one of your elemento is NOT a List.
You do not provide a link to your Google Sheet or an aia file. Because you did not provide that information, only you can test and debug. The error is introduced in one of your select list item input Blocks. Which one? Sorry I certainly do not know.
You can find out where the problem is by using the DoIt debugger and by temporarily disabling some of your code one block at a time. Disable code, then run the app. When the error message no longer appears, you found the Blocks that are causing problems.
doesn’t because the feedback is the same i already have. I know something is wrong but what this message means? because when i do the debug i get exactly the same info, not the solution or something more detailed, it’s really frustrating
when i convert the csv to a list in the first step with index 1,2 and 3, the list shows and it’s ok. I dont understand why doesnt accept and gives a value to select list item index 2, if before the list shows.
Doesnt make any sense!
Show us what a a print out of this List ‘when i convert the csv to a list in the first step with index 1,2 and 3, the list shows and it’s ok.’ looks like. Perhaps the csv is not converting properly.
Local variables may look nice in a coding class but they make debugging difficult. What you might do is instead of evoking your format Procedure (incidentally, format may be a bad label for a Procedure…try myFormat); try this
and do a DoIt and see whether it returns true or false.
In your case, I believe it will return false (but I don’t know what your Web component is returning.)…you can find out. Use some code like this to perform a test to see what the first item in your List actually is.:
What does the test tell you about the first element?
Once again, possibly a poor choice for the name of a variable (table… mytable is better) ; while not
in a list of reserved words for Java, the word might be reserved in AI2
This note may help other developers… Java ‘reserved’ words… avoid using these in renaming controls, procedures etc.
I did the test and it is a list
The suggestion of the labels to test the index is great, and now i see / identify the problem but still strange.
When i do add items to the list, the list does the split by colums, i did a check taking out index 2, and when i set up the list doesnt show the values of the 2nd column.
When i do select list item the result is the rows, if i choose index 2 returns row 2 = column 1 + column 2
The code uses three of your csv rows. It filters and selects all instances of Australia by row (column I2 in your spreadsheet). Change the term Australia for any other country to search based on a different country.
Reproduce the blocks, confirm this is what you want to do and use the blocks in your Project if appropriate.
Your problem is in one or both your Procedures. I do not know why since I cannot test your code. Notice, I did the comparison in a different way than you tried.