I'm using the built-in group service to pull a list of usernames...
function getUsersInGroup(group) {
var usersInGroup = GroupsApp.getGroupByEmail(group).getUsers();
return usersInGroup;
}
...and it returns an array, like this...
[ person1@email.com, person2@email.com, person3@email.com ]
What I would like is for those emails to show up in a spreadsheet column like this...
It seems that Apps Script's .setValues() wants a 2D array, even when the data is "flat", so I get the impression from my tests that my data has to be in a format like this...
var data = [[person1@email.com],[person2@email.com],[person3@email.com]]
If I want it to show up as rows of data instead of one item in a column.
If I'm correct, I think I'm looking for the best of two (maybe three) possible answers to my question.
What I think are Possible solutions
Transform the array and make each item in the array a one item array with probably a for loop
Find out there is a better built-in function that will take the array and turn it into a row of data
There's something else I could do that I didn't even consider here