- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 03:16 PM
The requirement is to get a list of users from catalog item form and assigned them to groups. I used the variable type:list collector for variable "Select User (g_1_user). In my workflow, I used "Run Script" to run the following script:
In logs, I got a list of user returned: , but when I was trying to use "split(",")" method to split each user, I got "undefined" the error (size====undefined). It seems "Split() " doesn't in workflow. Any suggestion how to split a list of users in workflow?
Solved! Go to Solution.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 01:48 PM
Cool - please mark as answered if this answered your question. Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 03:23 PM
it may be that that variable is not in a string format when you split it. Just to be sure, can you do this:
var group1Users = workflow.variables.g_1_user.toString();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 03:26 PM
Also make sure to check, the user list is not empty
if (group1Users!='')
addGroupMembers(groupName1,group1Users);
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 03:34 PM
As Jon stated, in workflow to need to .toString() your list collector variable before splitting it.
i.e.
var lc = current.variables.list_collector.toString().split(',');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 05:13 PM
it works when use toString()