- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 10:39 AM
I am trying to check if a user is already present in a group in AD, I figured the easiest way may be to parse the data from the failure message from the orchestration task "add user to ad" stating that the user is already in the group.
If this task fails it will create a ticket for service desk to do it manually, when there is multiple groups, I’d like to skip over the group in case the user is already in it.
Is there any way to get the data from the previous orchestration task and check the data in an if statement?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 10:59 AM
We use this IF function evaluate that failure (see Run Script below that occurs before this IF):
//IF STATEMENT: Was the user already a member of the group?
answer = ifScript();
function ifScript() {
if (workflow.scratchpad.addtogrouperror.indexOf("The object already exists") > -1) {
return 'yes';
}
return 'no';
}
This is the Run Script, prior to the IF Statement and right after the Orchestration Activity, that we use to grab the output/errors from the Orchestration Activity. Your data.get(#) would change to whatever number needed from your workflow - You find it on the "Data" tab on the far right in Workflow Editor when you have the workflow on your screen:
var addtogroupoutput = data.get(3).errorMessage;
workflow.scratchpad.addtogrouperror = addtogroupoutput;
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 10:59 AM
We use this IF function evaluate that failure (see Run Script below that occurs before this IF):
//IF STATEMENT: Was the user already a member of the group?
answer = ifScript();
function ifScript() {
if (workflow.scratchpad.addtogrouperror.indexOf("The object already exists") > -1) {
return 'yes';
}
return 'no';
}
This is the Run Script, prior to the IF Statement and right after the Orchestration Activity, that we use to grab the output/errors from the Orchestration Activity. Your data.get(#) would change to whatever number needed from your workflow - You find it on the "Data" tab on the far right in Workflow Editor when you have the workflow on your screen:
var addtogroupoutput = data.get(3).errorMessage;
workflow.scratchpad.addtogrouperror = addtogroupoutput;
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven