Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to split text to a row using appscript? [migrated]

$
0
0

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 belowoutput from the attendance app

I need help splitting the text using commas as delimiters into a row. Here's my expectation:enter image description here

here's the function 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); //CREATEif (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";  }else{    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 appattendance appAs 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...


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>