In Apps Script, create a menu where the user selects a range of cells and hits a button that activates the following function. With:
var dataRange = dataSheet.getActiveRange();
var dataValues = dataRange.getValues();
I transform the selection of the user in an array, but when I want to insert it in a table of a doc with :
var doc = DocumentApp.create(fileName.getResponseText());
var docID = doc.getId();
var file = DriveApp.getFileById(docID);
file.moveTo(destination);
var body = doc.getBody();
table = body.appendTable(dataValues);
I get the error in the title.
The format of the array is
[[HEADER C1,HEADER D1,HEADER E1,HEADER F1],[C2,D2,E2,F2],[C3,D3,E3,F3],[C4,D4,E4,F4]]
This works for me:
What do you mean when you say I transform the selection of the user in the array. Be specific. There is something your are not telling us.