How to split text to row using app script

Skip to first unread message

Mr Irsan

Mar 18, 2024, 2:26:21 AMMar 18
to Google Apps Script Community
I made a daily student attendance app using Kodular and a spreadsheet as a database. I connected the kodular to a spreadsheet using Appscript. The app worked well, but since I'm a newbie in app script I can only send the data to a spreadsheet as shown below
I need help splitting the text using commas as delimiters into a row. Here's my expectation:

here's the script I use to call the data from the app, I'm still a newbie and I just know basic functions like this:

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 ts = e.parameter.TIMESTAMP; 
var user = e.parameter.USER; 
var tgl = e.parameter.TANGGAL; 
var kls = e.parameter.KELAS; 
var nama = e.parameter.NAMA; 
var ket = e.parameter.KETERANGAN; 
var data = false; 
var lr = sh.getLastRow(); for(var i=1;i<=lr;i++){ 
var data_ts = sh.getRange(i, 1).getValue(); 
if(data_ts==ts){ data=true; } } 
if (data){ var result= "ID Sudah ada"; }
var rowData = sh.appendRow([ts,user,tgl,kls,nama,ket]); 
var result="Berhasil Input"; 
return ContentService.createTextOutput(result).setMimeType(ContentService.MimeType.TEXT); }

FYI, here's the image of the app
As you can see in the blue box, I intended to compile the data as one label per component ( timestamp in one label, name in one label, etc) as I planned to split it using appscript, It's just not resolved yet. Kindly need your help to resolve this problem...

Radian Muqorrobin

Mar 29, 2024, 6:12:50 AMMar 29
to Google Apps Script Community
is this problem resolved?

admin hbco

Apr 6, 2024, 7:21:20 AMApr 6
to Google Apps Script Community


It is possible to try this function (


function doGet(request){
    // Open Google Sheet using ID
    var ss = SpreadsheetApp.openById("1PhMwkI8EUNBJQck7YJLcxf2rFf1B_Q9YRSPYuaBpc4w");
    var sheet = ss.getSheetByName("Orders");
    var result = {"status": "SUCCESS"};
        // Get all Parameters
        var ProductId = request.parameter.ProductId;
        var ProductName = request.parameter.ProductName;
        var Amount = request.parameter.Amount;
        var Price = request.parameter.Price;
        var ProductSize = request.parameter.ProductSize;
        var CustomerContactNumber = request.parameter.CustomerContactNumber;
        var CustomerEmail = request.parameter.CustomerEmail;
        var CustomerLocation = request.parameter.CustomerLocation;
        var PaymentStatus = request.parameter.PaymentStatus;
        var OrderStatus = request.parameter.OrderStatus;
        // Append (Insert) data on Google Sheet
        var rowData = sheet.appendRow([ProductId, ProductName, Amount, Price,ProductSize,CustomerContactNumber,CustomerEmail,CustomerLocation,PaymentStatus,OrderStatus]);  
        // If error occurs, throw exception
        result = {"status": "FAILED", "message": exc};

    // Return Result
    return ContentService

Best Regards,


Basel El-Habil

Google Developer Groups - Gaza Organizer

Mob: (+972) -562-323008


admin hbco

Apr 6, 2024, 12:20:55 PMApr 6
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages