I hope you are doing dandier than usual.
I am stuck on this problem for a couple days now and I don't know where I am making a mistake. Basically, I want to copy a column from one sheet(let's call it DailyOrders), make some changes and paste it into a column in another sheet in the same workbook.
Here is what it should look like:
1: DailyOrders Column M
2: Copy 2D array to a temp variable
3: Convert those array elements to string and do the processing 1 by one and keep pushing them in another 2D array
4: Push the new 2D array to Column A in the "sort" sheet.
The Problem:
The for loop that should traverse the original array and push those elements into the pusher function runs for correct times when I put Logger.Log statement for testing, but only once when I call the pusher function. I have no idea why that is happening.
function sort(){
var values = SpreadsheetApp.getActiveSheet().getRange("DailyOrders!M2:M4").getValues();
var newvalues = [];
for(i=0;i<values.length;i++){
pusher(values[i]);
Logger.log(i);
}
function pusher(item) {
item = item.toString();
item = item.split("|| ");
for(i=0; i<item.length; i++){
newvalues.push([item[i]]);
}
//push newvalues[] to "sort!A:A"}
This is my first question at stack overflow, please let me know if you need any further explanation.
Sample worksheet to regenerate the problem:
https://docs.google.com/spreadsheets/d/1709A3kLPQ5eVCL_bQcRSc0U33hdIz9_3juouqesHYZM/edit?usp=sharing