How do I use an array as argument for my custom function in Google Apps Script in a spreadsheet

google-apps-script, google-sheets, javascript, multidimensional-array

Solution

Now this functionality is not implemented in GAS. There are similar questions in SO (here and here). You can post a feature request to the issue tracker.

Problem

I'm trying to create a custom function in my google spreadsheet with the script editor. I can't seem to allow the user to give the function an array as the argument. My script works when I hardcode like this: ``` var values = SpreadsheetApp.getActiveSheet().getRange("G2:j30").getValues(); ``` What I want to do is pass the array as an argument: ``` function arrayToList(chosenArray) { ... var values = SpreadsheetApp.getActiveSheet().getRange(chosenArray).getValues(); ... } ```

Original source

Related problems