I want to add users in group from Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 11:28 PM
My requirement is to add Users in group which they have selected in Catalog form field.
Once if a user select 'Add to group-A' choice of field 'Select group to Add' , I should automatically add the user to the group.
How can I do this using Workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 11:32 PM
Hi @Taaha M
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 11:38 PM - edited ‎12-04-2024 11:42 PM
Hi @Taaha M ,
You can Add Run Script Activity in your flow and add below script
var groups = current.variables.group_name.toString();
var user = current.variables.user_list.toString().split(',');
for (i = 0; i < user.length; i++) {
var newUser = new GlideRecord('sys_user_grmember');
newUser.initialize();
newUser.group = groups;
newUser.user = user[i];
newUser.insert();
}
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2024 12:50 AM
Hello Taaha,
Looks like you need to add user to Group selected. Please confirm your ask