'Insert a array in a row in google app script
I want to write in a cell of sheet an array that is inside an object
This is my gs code :
function sendText(data){
var sheet = SpreadsheetApp.openById("1isl9CFp4lllCoKNzbYWIE3QHPkj6NekY3l_nm20MVF8").getActiveSheet();
sheet.appendRow([null ,null ,null ,data.budgetName ,data.budgetDeadline ,data.budgetPayment ,data.budgetUrgency ,data.budgetArea ,data.budgetCurrency ,data.budgetTime ,data.budgetEmail ]);
return "succes!";
}
For example, With this variable inside the object I have no problem because it is not an array
budgetName: e.target["name-budget"].value,
but if inside the object I pass an array, when it writes it to the array it writes something similar to this
What can I do so that the array that I send inside the object is shown in the cell? Sorry for my english
Solution 1:[1]
How about
(data.budgetName.length > 0) ? data.budgetName.join(', '): data.budgetName
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Cooper |