I am new to GAS. I have two arrays. AR1 has 7 cols and 16 rows. AR2 has 7 cols and 4 rows. I want to push the small array (AR2) to the bottom of the big array (AR1) for AR1 to have 7 cols and 20 rows. This is my code:
AR1.push(AR2);
When I check if there is new data by setting the values of AR1 into the active sheet (sh):
sh.getRange(1,1,AR1.length,AR1[0].length).setValues(AR1)
I get an error: Exception: The number of columns in the data does not match the number of columns in the range. The data has 4 but the range has 7. And AR1 is written in the unchanged form in the active sheet with 7 cols and 16 rows.
It looks like AR2 is transposed in push command and/or not pushed to the end of AR1, but I don't understand why or how to fix it. Any help is highly appreciated.