How do you get csv result from MySQL?

I have a little problem, I can't make my table D: appear, I get "The second argument to foreach is not a list. The second argument is: "Id,EDT,Actividades,HHProgramadas,HHGanadas,HHdesviadas,trabajo,Resumen 1,1,PROGRAMA CONSTRUCCIÓN PGP 2019"...

Proyecto_N2 (1).aia (155,9 KB)

How can it be done so that when entering data from a .csv to the tableviewer it does not jump from column to having a ' , ', for example,

| Description | ID |
| Removal of channeling | cables and support |

when it really should be

| Description | ID |
| Removal of channeling, cables and support | 10|

Your response content is a table in csv format... to get a list of lists use the list from csv table block



MYSQL table:
Opera Captura de
APP Table:

Label APP:

In the app table it occupies a space that it shouldn't due to the fact that it has a ','

This is not related to TableViewer any more.
I moved to a new thread.

1 Like

Show your mysql response content before you do anything to it, as text...

Taifun has already advised you to convert your csv table to an AI2 list

Also, we do appear to be going round in circles. I am certain we have covered this already in one of your other posts....

table.txt (50,5 KB)
this i have from response content

1,1,PROGRAMA CONSTRUCCIÓN PGP 2019 ,0,2024.3000000000002,2024.3000000000002
2,1.1,   LINEA DE FIBRA,0,2024.3000000000002,2024.3000000000002
3,1.1.1,      ÁREA 331,0,2024.3000000000002,2024.3000000000002
4,,         LINEA 2,0,280.3,280.3
5,,            Grua Desatolladora,0,217.60000000000002,217.60000000000002
6,,               Demolición dados cortina y construcción fundaciones

yes, this is also called a table in csv format as I already tried to explain... see my previous answer...

EDIT: and as you can see from the Do it result, there are spaces inside your values (before "Limpiar")

16,,               Limpiar, pulir y rebaje en plancha transversal entre conexión entre transporte,0,0,0

you can remove these spaces using the trim block from the text drawer


something like this?
Opera Captura de

No... you have to select the corresponding list item, then you can remove leading spaces of that list item

See also the documentation MIT App Inventor Text Blocks

Alternatively make sure, that there are no leading spaces in your data on the server...


In order to handle a comma within one of your fields, you will need to add double quotes around each field in your file, or simply remove any commas in fields in your data


"14","","               Inicio PGP19","0","0","0"
"15","","               Montaje de plataforma de servicio","0","0","0"
"16","","               Limpiar, pulir y rebaje en plancha transversal entre conexión entre transporte","0","0","0"
"17","","               Montaje de cadenas","0","0","0"
"18","","               Reparación de chute existente bajo power feed","0","0","0"


14,,               Inicio PGP19,0,0,0
15,,               Montaje de plataforma de servicio,0,0,0
16,,               Limpiar pulir y rebaje en plancha transversal entre conexión entre transporte,0,0,0
17,,               Montaje de cadenas,0,0,0
18,,               Reparación de chute existente bajo power feed,0,0,0

which ever is going to be both will require some manual editing

1 Like

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