- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 07:28 AM
Hi,
My scenario is - I had created a new catalog item variable called User(Referrence field). When I select any particular user (e.g. Abel Tuter) and submit the catalog item record, selected user (Abel Tuter) needs to delete permanently from the User(sys_user) table. Please let me know if you have any idea regarding this. Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 08:46 AM
Hi @praveen1231,
I understand that is the requirement, however part of our job is to give advice.
Not every requirement should be fulfilled if there are better ways to do it, or if it is better to not do it at all.
I'll leave it up to you what to do with that. Just keep in mind a trusted advisor is valued even more than a good developer.
That being said, since you are using a catalog item, the easiest way to handle it, is to create a flow with flow designer.
Lookup the user from the variables, update the user, or delete if there is is no other way forward.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 08:59 AM
@praveen1231 You can simply choose to create workflow/flow which will be used as a process engine on your Catalog item.
Inside the flow/workflow you can extract the user reference variable from the requested item, and use a Run Script Activity/Delete Record step to delete the record from the sys_user table.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 11:18 AM
@Sandeep Rajput Can you please share some screenshots regarding the script. It must help me to solve. Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 11:41 AM
Hi Praveen,
As suggested in comments before ideal is to get the profiles marked inactive instead of deleting it. Also, did you try something already? If so, where are you stuck?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 11:54 AM
Thanks for your reply @Jaspal Singh. My requirement is to delete the particular user from User(sys_user) table who is selected in reference field. Actual scenario is User(sys_user) is considered as employee. When employee quit his job and left the company, company will send a form to the employee and employee need fill it with his details and when he submits the form employee details will get delete from the company portal. And finally, I got the output. Thank you😇.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 11:56 AM
@praveen1231 Thank you for the details. However the question is why delete? ServiceNow has logical deletion (Active: True/False) why not use that instead of physical deletion.
Hope the solution you opted for is logical deletion and not physical deletion.