Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Using Microsoft Active Directory v2 Spoke in Flow Designer: Add User to Groups Action

jmiskey
Kilo Sage

In a Flow based on a Catalog Item, I am trying to use the "Add User to Groups" action from the "Microsoft Active Directory v2 Spoke".  It requires that I provide the "User Name" and "Group Names", and it says that the Group Names field must be a "array.string type pill":

jmiskey_0-1708612556498.png

 

On my Catalog Item, the fields requested look like this:

jmiskey_2-1708612883294.png

The AD Groups variable field is a List Collector, coming from a Custom table that has two fields:

 

jmiskey_1-1708612631911.png

On this Custom table, the "Group Name" field is the Display field, but I believe the "AD Group Codes" are the values that I want.

 

It will not let me drag the "AD Groups" data pill from the Catalog Item into the "Group Names" field (presumably because it is not an array).  So it appears that I somehow need to create an array-type data pill to drop into this "Group Names" field.  

 

What is the best way of doing that? 

Should I try to do it in a "Flow Variable"?

Or should I create a variable on my Catalog Item and populate it in a Catalog Client Script?

Either way, I am not sure how to create this as an array-type field so that the "Group Names" action will accept it.

 

 

 

 

 

2 REPLIES 2

bekfro
Kilo Sage

I have the same question, did you get anywhere with this?

jmiskey
Kilo Sage

I believe I created a Flow Variable of String type, then looping through all my selections, and added them to the string, separated by a comma (so I created a comma-separated string).

 

I then created a Custom Action to convert that string to an array, and used that array in the action to add them to AD.