Help ! Read all problem

i use readall Func to import data from sheet to list View every thing is going well but when the records reach 8 rows start to show the result of just 7 records and if i add records always missing the last row didn't appear in the list view as the below photos

any Idea please where is the error


Hello aiad_ali

Very difficult to read your Blocks - next time, use App Inventor's right click menu "Download Blocks as image".

There is a lot going on in your "Read All Records" code - the data of interest is a single column, so why are you post fixing a comma delimiter and an end of line delimiter to every row? Use one or the other but not both.

I suggest you "pour" the data, without any manipulation, into a Text Box, to see exactly what you receive.

The "For Each" loop in Web1 is redundant, if you seperate the values in the outstring with a comma, you already have a string list that can go directly into the ListView.

The code is designed to handle any size of table - n columns x n rows and to return a text of csv table format

Unfortunately, the person who copied my code and made youtube videos didn't get things quite right, which may be causing some problems. For your requirement:

This sheet


with this web app script:

function doGet(e) {
  var ss = SpreadsheetApp.getSpreadsheetById(e.parameter.ID);
  var sh = ss.getSheetByName(e.parameter.SH);
  var rg = sh.getDataRange().getValues();
  var outstring = '';
  for (var row = 0; row < rg.length; ++row ) {
    outstring += rg[row].join(',') + '\n';
  return ContentService.createTextOutput(outstring);

with this url:

returns this in a browser:


and with these blocks

returns this in a listview:

You do need to scroll down to show all the entries.....

1 Like

many thanks i will Try

Wrong Code