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

machine

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

image

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:

https://script.google.com/macros/s/AKfycbyT8bzNn-3L3BN9CZpCIGV3Ot-S8GteCmWRDkAs4hkN/dev?ID=1uVdDMe6FCWjrwOwWsMI5vg44Bjv48IhUK_szm__8bsI&SH=Sheet1

returns this in a browser:

Machine
A01
A02
A03
A04
A05
A06
A07
A08
A09
A10
A11
A12

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