Hi Andrew and Gareth,
Sorry for the confusion, it is not possible to populate or update a choice list (select one or multiple) from a JS function. It is possible to return a value from another source based on a query or calculation, or return a comma separated list or JSON object, however you still need to process it into the survey as a value into a question.
We are currently working on a new feature in beta, for 3.12 beta update, which will allow you to use a select one or multiple and use the search() function to query a feature service and populate the choice list directly. I believe this is what you are after. Keep an eye out for the next Early Adopter Community update and documentation, on how you can test this out in 3.12 beta.
Regards,
Phil.