How to configure actions in flow designer for user who wants to add in multiple AD security group

Dhanaja Rode
Tera Contributor

How to configure actions in flow designer for user who wants to add in multiple AD security group

 

two groups inputs are from decision table separated by comma sec1,sec2

 

1 ACCEPTED SOLUTION

msd93
Kilo Sage

Hi @Dhanaja Rode 

 

Try below steps:

1. Open the Flow Designer in ServiceNow.

2. Click on 'New' to create a new flow.

3. Provide a name and description for the flow.

4. Click on 'Begin Flow' to start creating the flow.

5. Add a 'Lookup Record' action to fetch the user record who needs to be added to the AD groups.

6. Add a 'Script' action to split the input from the decision table into an array of security groups. You can use the JavaScript split() function for this.

Here is a sample code:

var groups = current.decision_table_field.split(',');

7. Add a 'For Each' action to iterate over the array of security groups.

8. Inside the 'For Each' loop, add a 'Lookup Record' action to fetch the AD group record.

9. Add an 'Update Record' action to add the user to the AD group.

10. Save and test the flow.

 

Hope this helps you.

View solution in original post

1 REPLY 1

msd93
Kilo Sage

Hi @Dhanaja Rode 

 

Try below steps:

1. Open the Flow Designer in ServiceNow.

2. Click on 'New' to create a new flow.

3. Provide a name and description for the flow.

4. Click on 'Begin Flow' to start creating the flow.

5. Add a 'Lookup Record' action to fetch the user record who needs to be added to the AD groups.

6. Add a 'Script' action to split the input from the decision table into an array of security groups. You can use the JavaScript split() function for this.

Here is a sample code:

var groups = current.decision_table_field.split(',');

7. Add a 'For Each' action to iterate over the array of security groups.

8. Inside the 'For Each' loop, add a 'Lookup Record' action to fetch the AD group record.

9. Add an 'Update Record' action to add the user to the AD group.

10. Save and test the flow.

 

Hope this helps you.