Since you have tested this maybe you can provide the information so others can learn.
May be, but what if the sheet is already read when the app is started (e.g. in the Screen.Inititialize
event) and then displayed later when it is needed?
@Anke @Peter @TIMAI2
Refer Below Screenshot & check the Start time & End time
I just created a demo app for only Read Data From Sheet. You can also check the similar way for other operations like Read and Write Row or Column, etc... where the time difference is what i said in
AIA File:
APIvsAppsScript.aia (20.3 KB)
APK File: Import and Export from above AIA from http://sheets-dot-ai2-ewpatton-temp.uc.r.appspot.com/
Sheets Link: https://docs.google.com/spreadsheets/d/1fVckzWbUFR7raKhhoOTowvbhn3Xp7spbajeQmArNaTg/edit?usp=sharing
Hope it's clear that why I'm suggesting the free API method because of speed and the speed is also 99% similar to the Firebase Database which is paid db.
I concur. Did some testing, all on the Google Sheets Component test server. I don't have a service account set up, so my test with the new component was without credentials. My test google sheet, is "anyone can view", had 100 rows and 8 columns of random data. The screenshot shows start time (from button click), end time (to data display) and accumulated time in milliseconds. I also tested a gviz query and the usual export as csv. I used my replicant extension for Google Sheets.
The timings vary wildly from test to test on the same method,, which I guess is due to the state of the network at the time, but in general:
- Gviz is by far the quickest
- CSV comes in second (export?format=csv)
- Google Sheets Component
- Google Apps Script
Not something to really lose any sleep over, most of the problem appears to be network latency, when the network is really switched on, they are all as fast as each other, best times being in the 500 - 1000ms range.
I can live with a 1000ms overhead on my google apps scripts, not exactly mission critical
I accept this, that gviz is fastest, but the sheet should be shared public on internet.
Hi Anke,
Doubt, should I be able to delete a row from the google spreadsheet when y select an item from the list, even if the Item are read in format CSV ?
Let me explain you waht I am traying to do.
I need to filter a colomn text from an spreadsheet, then I need to show those items in a list view , select ant specific item and errease the row with a botton
Before you do anything detailed in the test server, you should know that the Spreadsheets component will be released on ai2.appinventor.mit.edu within the next week.
you mean that we are not be able to use spreadsheet with App inventor any more ?
Just the opposite. Right now, the Spreadsheet component is only available on a testing server. Next week, we hope to make it available on our regular site.
Such a good news, great!!
So this is one of those fun (?) little details about how the internals of App Inventor works that causes things to break in odd ways. As a workaround, you could assign the result to a label's text field and then use that in the data. The internal fix is straightforward but likely an edge case the original implementor did not consider.
(added to Open Issues section of FAQ)
I couldn't spot if this issue has already been raised.
I tried to AddRow to an empty sheet on a spreadsheet.
This returned an error and did not "post" the data to the sheet:
"AddRow: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference"
Everything worked fine once I had at least the first row with some data in it (even just A1)
(added to Open Issues section of FAQ
This is new to me, a 0-based row number return in filtered Get Rows request reponses.
I encountered this trying to do a simple sample of logging Arrivals and Departures in the same row.
I used my NYC Marathon sample as a framework, with an extra sheet for Arrivals/Departures:
Notice how this bug overwrote the Departure Time heading on column D, and logged Departures one row too high (-1 row) for each update.
Adding Arrival Times is straightforward:
- Add a new row with just the arrival time and other details, departure time 0.
Adding Departure Times is a two phase operation,
- ask for a filtered list from the Arrivals/Departures log for the runner in question
- Take the last row number from the returned row number list.
- Use it to update column 4 (D) of that row number.
Here are the blocks:
The incriminating Do It result for the first occurence, where the column 4 heading got overwritten:
The exported .aia file, if you want to play:
MarathonSheetsWithArrivalDeparture.aia (20.0 KB)
The sheet:
If you have a previous thread where this error was found, please point to it.