- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 01:22 AM - edited ‎01-16-2025 01:23 AM
I have a flow where reqfor user should be automatically removed from group when requested. We have a list collector group field and when submitted reqfor user should be removed from the mentioned groups in that field . I created action for that but it seems deleteRecord() method is not working in flow...the script was working fine in workflow and user was getting removed.. I have also automation to Adduser and that is working correctly can nyone help me in this
Attaching script for removal from action.:-
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 07:05 PM
Below is the working solution, user was part of 2 groups and flow ran and removed that user from those groups
I believe I have provided enough guidance and responded to all your questions.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 06:38 AM
Do this
1) Get catalog variables
2) then use Lookup records on sys_user_group with condition as
SysId [=] Get Catalog Variables->Assignment Group
3) then use For each to iterate over the Lookup records (sys_user_grmember)
4) then use Delete record and pass the sysId of each group and you already have ReqFor
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 06:50 AM
I got ur point ankur i am just not understanding the 4th point what to take please help me in that attaching ss @Ankur Bawiskar and please check if lookup and foreach is correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 06:54 AM
Lookup records condition should be this as we have multiple sysIds
sysId [IS ONE OF] Get Catalog Variables->Assignment Group
Within For Each
-> use Lookup records on sys_user_grmember
condition as [Group.sysId] [IS] Group (from each iteration)
-> then use Delete Record for sys_user_grmember
I missed 1 more step which was for Lookup of sys_user_grmember
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 07:21 AM
Not working @Ankur Bawiskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 07:37 AM
in flow execution what it shows?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader