- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2018 03:50 PM
Out of curiosity, aren't you only applying the first group in your array to the users AD account? From the example above, in your "Add user to AD group" activity, you set the 'Group Name' field to: ${workflow.scratchpad.group[workflow.scratchpad.counter]}
And since you declared in your run script that workflow.scratchpad.counter = 0; Wouldn't this only apply the first group/object in your array to the users account?
Sorry to nitpick, I'm just trying to understand your code since I also need to apply multiple groups to an AD account. I'm having some issues though.
My post is here:
https://community.servicenow.com/community?id=community_question&sys_id=45aa0673db16db04fac7f4621f961941&anchor=answer_76cf963bdb1a5744852c7a9e0f961947
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2018 05:50 AM
What is your "If" conditions? in the Check Counter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2018 06:20 AM
// This script needs to set answer to 'yes' or 'no' to indicate the state of the activity.
//
// For example,
//
// answer = ifScript();
//
// function ifScript() {
// if (condition is true) {
// return 'yes';
// }
// return 'no';
// }
answer = ifScript();
function ifScript() {
var check = 'no';
workflow.scratchpad.counter ++; // increment the counter
// check the counter and see if we need to go again or stop
if (workflow.scratchpad.counter < workflow.scratchpad.count) {
check = 'yes';
}
return check;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2019 01:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2019 01:33 PM
Drew,
Can you please share the code for Run Script & If condition for adding multiple users to same group in the above subscription workflow?