Hi. I am trying to send three data through the web and then insert it into a spreadsheet. The insert part in the spreadsheet works fine. The problem is that the Do Get function, when accessed from the web browser, does not detect the 3 values as values of an array but as a single meaningless string.
When I use the debug everything works great and the three values are written correctly.
the code is the following.
// This method will be called first or hits first
function doGet(e){
Logger.log("--- doGet ---");
var tag = "", value = "",Temperatura="",Humedad="",Presion="";
try {
// this helps during debuggin
if (e == null){e={}; e.parameters = {tag:"test",value:[24.2,69.3,970.5]};}
tag = e.parameters.tag;
value = e.parameters.value;
Logger.log(e);
Temperatura=e.parameters.value[0];
Humedad=e.parameters.value[1];
Presion=e.parameters.value[2];
// save the data to spreadsheet
save_data(Temperatura,Humedad,Presion);
return ContentService.createTextOutput("Wrote:\n tag: " + tag + "\n value: " + value);
} catch(error) {
Logger.log(error);
return ContentService.createTextOutput("upsi...." + error.message
+ "\n" + new Date()
+ "\nvalor " + value);
}
}
// Method to save given data to a sheet
function save_data(A , B , C){
Logger.log("--- save_data ---");
try {..
....