- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 05:40 AM
I am trying to use the "Microsoft Active Directory v2 Spoke" in Flow Designer to add/remove people from AD groups. On my Catalog Item, I have a List Collector field where they can select all the groups that they want to be added to/removed from. I have then built a Custom Action that loops through my List Collector, and builds a string of all the AD Codes that they need to be added to, separated by commas. So the output is a comma separated string.
If I go out to Flow Designer, go into the "Microsoft Active Directory v2 Spoke" and choose the "Add User to Groups" Action, there is an argument for Group Names that looks like this:
If I try to "drag-and-drop" the data pill from the output of my Custom Action, I get an error message that says "String is not allowed here". I am not sure how to convert my output string from my Custom Action into an "array.string". That doesn't even look like a valid data type I can use in my variables!
What do I have to do to get my output into an "array.string" field type so I can use it in this Group Names field?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:03 AM
OK, I think I got it figured out now.
In the Script step part of my Custom Action, I need to set-up an output variable that is of "Array.String" type, i.e.
Then, in my Script portion, to first set up an array field in the script like so:
var codes = [];
and then populate it with array values as I loop through my GlideRecord:
while(gr.next()){
codes.push(gr.field_name));
}
outputs.output_array = codes.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 12:41 PM
Configuring the same process as above, can you let me know the steps of the action you created to look up all the groups a user is a part of to be able to remove the user from those groups?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 08:33 AM
I was not looking up all the groups the person may be a part of. I was looking up all the selections made on the form, and seeing if the person is a member of those particular groups.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 11:38 AM
So much for no-code functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 07:32 AM
Hi @jmiskey
Can you please share more detail so that I can use the same to solve the issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 04:26 AM
Here are the details of my Custom Action:
Inputs:
Script step:
Script:
(function execute(inputs, outputs) {
var str = '';
var prevValue = '';
var curValue = '';
//loop through list collector (Glide Record)
var gr2 = inputs.lc_variable;
gr2.query();
while(gr2.next()){
//see if new Display Value different from previous one
curValue = gr2.getDisplayValue();
if(curValue!=prevValue){
//add to running list
str += curValue + ',';
}
//reset previous value
prevValue = curValue;
}
//remove last comma from string
str = str.substring(0, str.length-1);
//set string to output
outputs.output_string = str;
})(inputs, outputs);
Outputs: