issue with :
var data2 = eval("["+ e.parameters.csvdata1 +"]");
issue with :
var data2 = eval("["+ e.parameters.csvdata1 +"]");
in a post https://sites.google.com/view/metricrat-ai2/guides/export-csv-data-multiple-data-to-google-sheetI found this instruction line that allowed me to convert a csv format line to a table
it worked.
a few weeks later I use this same instruction it works randomly
what can explain this? an evolution of script apps?
however I tested the script without the application and everything suggests that it comes from the application and yet I have verified that I am sending the data
from the data I send, i.e. lists that have been transformed into csv line
I tried without the application this
var data2 = JSON.parse("dog","mouse","cat","house")
function doPost(e) {
var data = e.postData.contents.split(",") ;
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName('Sheet1');
sh.appendRow(data);
return ContentService.createTextOutput(data) ;
}
function doPost(e) {
var data = JSON.parse(e.postData.contents) ;
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName('Sheet1');
for (var i=0;i<data.length;i++) {
sh.appendRow(data[i]);
}
return ContentService.createTextOutput("Success") ;
}