Flow that automates adding/removing group type to a user group after Request from Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2025 12:43 AM
Hi all,
i need some help. We have a catalog item for users to request if they want to add or remove group types like itil etc. The user puts the information in variables and after that i call them in the flow.
And how can i change the group type? If i select the table user group there is only a field Type. And in this field i cannot enter either the variable or the sysid of the variable.
Has someone a solution? Or an idea how i can automate it. It must be via Catalog Item the request.
Thanks
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2025 12:52 AM
Hi @AlexanderH23091 ,
- Get Catalog Variables: Start your flow with the trigger from the Service Catalog and use the 'Get Catalog Variables' action to retrieve the variables from your item.
- Look Up the Group Record: Use the 'Look Up Record' action to find the specific user group record that needs to be modified.
- Table: User Group [sys_user_group]
- Condition: [Sys ID] [is] [your group_to_modify variable]
- Use a Flow Logic 'If' block: Drag the action_type variable into the condition to check if the user wants to "Add" or "Remove".
- Update the Record (Add or Remove): Place an 'Update Record' action inside both the 'If' and 'Else' blocks.
- Record: Use the data pill from the 'Look Up Record' step [2->Group Record].
- Fields: Select the Type field.
- Action: Click the script icon (</>) next to the 'Type' field to open the script editor.
// Assumes you have looked up the group record in a previous step (e.g., step 2) var currentTypes = fd_data._2__look_up_record.record.type.toString();// Get the sys_id of the type to add from your catalog variable var typeToAdd = fd_data._1__get_catalog_variables.group_type_to_change.toString(); if (currentTypes == '') { return typeToAdd; // If the list is empty, just add the new type} else { // Combine the current list with the new type, separated by a comma return currentTypes + ',' + typeToAdd; }
// Assumes you have looked up the group record in a previous step (e.g., step 2) var currentTypes = fd_data._2__look_up_record.record.type.toString();// Get the sys_id of the type to remove from your catalog variable var typeToRemove = fd_data._1__get_catalog_variables.group_type_to_change.toString(); // Split the comma-separated string of sys_ids into an array var typesArray = currentTypes.split(','); // Find the index of the type to remove var index = typesArray.indexOf(typeToRemove); // If the type is found, remove it from the array if (index > -1) { typesArray.splice(index, 1); } // Join the array back into a comma-separated string and return it return typesArray.join(',');
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
Thanks, GP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2025 12:55 AM
Hi Ponsekar,
thank you for your quick response. I will try this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2025 11:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2025 11:43 PM
Ah sorry i found it ok sorry, i didnt see the name property. This works
