This is incorrect.
$gameVariables.setValue(x, y)
needs the id x of the variable and the value y to set. You can't cut off the value and expect it to work.
There is actually an error in the example provided in the script call spreadsheet.
In the spreadsheet the code looks like this:
JavaScript:
// Save
$gameVariables.setValue(id,
$gameParty.members().map(function(actor) {
return actor.actorId();
});
);
However the ; in the second to last line ends the statement prematurely. The last ); get treated as their own second statement after the first. That is why the first statement is missing its closing ).
The following should work as intended:
JavaScript:
// Save
$gameVariables.setValue(id,
$gameParty.members().map(function(actor) {
return actor.actorId();
})
);