Have a better, more rounded solution to handle inline (`one\ntwo\nthree) and user Enter pressed line returns, for both doGet(e) and doPost(e).
It is necessary to convert both types of strings with line returns to lists (arrays) in AppInventor, and to then convert these lists back to strings with line returns in the google apps script. This is due to the way textboxes and text blocks handle typed in \n and non typed in \n - with one being treated as text, the other being treated as a non printing line return (the same with Enter pressed line returns). To overcome this I have created a small procedure that handles both scenarios, and converts the textbox string to a list, to send to the google apps script, and then on to the spreadsheet.
doGet(e)
function doGet(e) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName('Sheet1');
var data = [];
var content = e.parameter;
for (var k in content) {
var cell = JSON.parse(content[k]);
data.push(cell.join('\r\n'));
}
sh.appendRow(data);
return ContentService.createTextOutput(data);
}
doPost(e)
function doPost(e) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName('Sheet1');
var data = [];
var content = JSON.parse(e.postData.contents);
for (var i=0; i<content.length; i++) {
data.push(content[i].join('\r\n'));
}
sh.appendRow(data);
return ContentService.createTextOutput(data);
}


