Using kodular’s built in sqlite extension I am able to create tables and insert data into my table but how do I read and loop through the results?
This is my sql to create the table: CREATE TABLE IF NOT EXISTS meters ( meterid TEXT NOT NULL, metername TEXT NOT NULL, email TEXT, lat REAL, long REAL, startmonth INT, startday INT, updatedat TEXT, CONSTRAINT idemail UNIQUE (meterid));
To insert the data i ran this one a few times, changing values.
I can display all the results as shown in the first 2 blocks below, but if i try to get a specific value (3rd and 4th block) I get this error: The operation select list item cannot accept the arguments: , [meterid,metername,email,lat,long,startmonth,startday,updatedat], [1]
You are using label inside the for each item list, if so the label will show the last value of the item in the list… If you use add items to the list to any local or global variable and set the label to show text of that variable, then you will see the whole result
Thanks for the response. I am aware of that. I am simply trying to at least display 1 value for now, but even that does not work because the select list item responds with this error:
The operation select list item cannot accept the arguments: , [meterid,metername,email,lat,long,startmonth,startday,updatedat], [1]
I am assuming that the row result is not a list, but also a dictionary result does not seem to work.
The reason is, global metres is not acceptor consider as list by the app. Since you are getting the result as CSV format in global meters, just add
list from CSV row text to list (get global metres ) in the place of for each row in the list and try. You will see the last item of the result