Read data from spreadsheet

I found this script on youtube CREATE - Membuat CRUD dengan Database Google Spreadsheet di Kodular/ MIT Appinventor #Part1 - YouTube

function doGet(e) {
return ceksheet(e);

function doPost(e) {
return ceksheet(e);

function ceksheet(e){
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName(e.parameter.SH);

if (e.parameter.func == “Create”) {
var nis = e.parameter.NIS;
var nama = e.parameter.NAMA;
var alamat = e.parameter.ALAMAT;
var data=false;
var lr= sh.getLastRow();
for(var i=1;i<=lr;i++){
var data_nis = sh.getRange(i, 1).getValue();
if (data){
var result= “ID Sudah ada”;
var rowData = sh.appendRow([nis,nama,alamat]);
var result=“Berhasil Input”;
return ContentService.createTextOutput(result).setMimeType(ContentService.MimeType.TEXT);

if (e.parameter.func == “Read”) {
var rg=sh.getDataRange().getValues();
var data=“”;
for(var row=1;row<rg.length;++row){
data +=rg[row].join(‘,’)+‘\n’;
return ContentService.createTextOutput(data).setMimeType(ContentService.MimeType.TEXT);


what I want to ask is how to make the data display from the spreadsheet on //Read be descending?

Show your spreadsheet structure…

Show us what have you tried so far.

I just copied the script and edited the variables according to the spreadsheet column

Order by which col?

ascending display, how to descending?

descending by what?

Column No.

Sorry, my mistake. Wrong youtube link.
This is the right one 2. CRUD SpreadSheet(Read) - Kodular | MIT App Inventor | Appybuilder | Thunkable - YouTube

Problem solved, just reverse list on get data