How to build Add members to a group using Catalog item and flow designer.

prasannakumard
Tera Guru

Hi Team,

 

There is a catalog items with field as below:

Group - Reference - Group table

Users - List Collector - User table

After submitting the catalog item, 

1- If any selected user is a selected group manager, User automatically add into selected group.

2- If not, Approval send to Selected group Manager. After Manager approves, those users automatically add into that selected group.

Please provide the Flow designer steps and if any related scripts, it would be very helpful to me.

 

Thank you for your help in advance.

 

Thanks & Regards,

Prasanna Kumar

4 REPLIES 4

Abhit
Tera Guru

@prasannakumard  - Can you be more specific to the your 1st point, Select user should be Group manager of the group selected or any other group manager. or did you meant if the request is submitted by group manger?

 

Abhit

Hi @Abhit 

If I select Group as ABC Group (Manager = XYZ), If I select User field as XYZ, ABC, DEF

XYZ automatically add into ABC Group, for ABC, DEF, we should send approval mail to XYZ.

Thanks & Regards,

Prasanna Kumar

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @prasannakumard ,

 

Create a action  in flow desinger which can add user to group.

 

  1. Create a new Flow Designer flow with a Service Catalog Request trigger.
  2. Add a form element to the flow to gather the user name and group that the user wants to be part of.
  3. Add an approval element to the flow, configured to send an approval request to the group manager of the selected group.
  4. Add a decision element after the approval element, with a condition to check if the approval was approved.
  5. If the approval was approved, add a script element to the flow to add the user to the group and send a notification to the user.
  6. If the approval was not approved, add a script element to send a notification to the user indicating that their request was denied.

You can use the addMember() function of the Group class to add the user to the group, and the sendEmail() function of the MailAPI class to send notifications to the user and the group manager.

 

https://www.youtube.com/watch?v=dlHRauVPPYQ


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Catalog and Flow Design run through of adding users to a ServiceNow Assignment Group with Flow Designer! #servicenow #servicenowflowrider

@Sohail Khilji Yes, you are right. I've also same idea, but, I'm having very less knowledge on Flow designer. If possible, can you plz provide the Flow designer steps and their scripts. I've created flow designer as mentioned below:

prasannakumard_0-1714113221576.png

Can u plz let me know if any changes here.