- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 07:37 AM
I have an intake form with a List Collector variable (Variable: list_role) on it which references a table (Table: u_role).
I have another table (Table: u_approvers1) that has a reference to the same table.
Within this item's workflow, I need to be able to take the values from list_role, compare them against the tables in the u_approvers1 Table, and create Approval records for each.
What's the best way to attack this? I have the start of what i think is needed to pull list_role apart but after that I'm not sure what to do with it.
*****
var list = current.variables.list_role.toString();
var array = list.split(",");
for (var i=0; i < array.length; i++) {
var rec = new GlideRecord('u_approvers1');
What do I do here?
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 10:17 AM
I understand that, but if you're using a Group Approval activity, that requires the returned array contain group ids. Because you're using user ids, I think you want to use a User Approval activity instead of a Group Approval activity.
See: Group Approval and User Approval
Group Approval says
User Approval says
So, if you're using sys_ids that are sys_user records, you want to use a User Approval activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 10:10 AM
approval.u_approver is a Reference to the User table. I've checked the gs.log and it is spitting out sys_id that match correctly to the User table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 10:17 AM
I understand that, but if you're using a Group Approval activity, that requires the returned array contain group ids. Because you're using user ids, I think you want to use a User Approval activity instead of a Group Approval activity.
See: Group Approval and User Approval
Group Approval says
User Approval says
So, if you're using sys_ids that are sys_user records, you want to use a User Approval activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 10:22 AM
Thanks Matthew, that was the issue. Script works fine when it's in the right kind of Activity. 😉