Spilt received text to many row in google sheet

I'm using App scrip to send data to Google sheet i ask about how to spilt input data from web app to google sheet i try to add \n for the data range but can't success any help ??

Blockquote
function myFunction() { var ss = SpreadsheetApp.getActive(); var sh = ss.getSheets()[0]; var data =["A", "B", "C", "D", "E", "s", "G", "J", "K", "L", "M", "N" , "\n" , "A", "B", "C", "D", "E", "s", "G", "J", "K", "L", "M", "N" ];
sh.appendRow(data);

return ContentService.createTextOutput("Success");

append.Row will do just that, append the array of data to a row.

You will need to manipulate your array in order to append twice, something like this:

function myFunction() {
  var ss = SpreadsheetApp.getActive();
  var sh = ss.getSheets()[0];
  var data =["A", "B", "C", "D", "E", "s", "G", "J", "K", "L", "M", "N" , "\n" , "A", "B", "C", "D", "E", "s", "G", "J", "K", "L", "M", "N" ];
  
  
  var first = new Array();
  var splitItem = "\n";
  
  for (var i=0; i < data.length; i++) {
    if ( i != splitItem ) {
      first.push(data.shift());
    }
       }
  data.shift();
  
  sh.appendRow(first);
  sh.appendRow(data);
}

It would probably make more sense to send your data to the script as a list of lists (array of arrays) instead of a csv table string....for example...

function myFunction() {
  var ss = SpreadsheetApp.getActive();
  var sh = ss.getSheets()[1];
  var data =[["A", "B", "C"],[ "D", "E", "s"],[ "G", "J", "K"],[ "L", "M", "N"]];
  for (var i=0; i < data.length; i++) {
  sh.appendRow(data[i]);
  }
}

thanks it work with me