How do I upload a csv file to be a list?

Exactly the question. What are the blocks needed to put a csv file into a list? Already uploaded the .csv files, but don't know where to get started with trying to make the contents of the list the csv file.
image

image

I'm uploading several cvs files for different lists, should i intialize different listdata variables?

also, where can one find this block?
image

Alternatively, you may use below extension to read and get required data like rows or columns as a list from csv file.

image

The easiest way to read multi csv files for you is to use several File components, one File for one csv.

1 Like

I have eight options in my spinner, and I'm planning that a list pertaining to that option will show in my listpicker. Have not started on any blocks. Help much appreciated.

make a dictionary DICT like:

{
"key1":[item11, item12, item13...],
"key2":[item21, item22, item23...],
"key3":[item31, item32, item33...]
}

set spinner.elements to Dictionary.getKeys(DICT)
after spinner.selected,
set listpicker.elements to Dictionary.getvalueforkey(spinner.selection, DICT)

@angel_Cardeno Your two post is relevant, so I merged them.
You can save your several csv files in one file, organize your data like last post, then read the csv with one File component, then decode the text to Dictionary, using Web.JsonTextDecodeWithDictionary

what block should i attach the make dictionary block to? I'm afraid I am not very knowledgeable of app inventor so I would like to see the blocks for it. also, what values to the key1...3 and items stand for?


also, here's what i did with the .csv files. Is this good?

edit: I tried to run the app, but it showed this error:

You need LIST FROM CSV TABLE, not LIST TO CSV TABLE

And make sure your csv is correct format.

OHHHHHHHHHH. will change the blocks.
image
as for the csv file is the right one? there's several when i try saving my excel files and I don't know which one is the one that should be used.

open the csv file with notepad, and show us what is inside it.

here is what the .cvs file looks in notepad:

this is not a csv format.
csv looks like

aa,bb,cc,dd
ee,ff,gg,hh
df,gadg,agf,fg

This is a single column file, which can be turned into a simple list with a Split Text At \n block. The quotes can be replaced with empty text first .

Using single component we can populate the list. First be ready with proper csv file and try

Also consider switching to a multi-column table, with an extra column for the category.

This would eliminate the need to orchestrate so many table loads.