Script to get currently deactivating multiple users sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 04:27 AM
Hi,
I deactivated multiple users into list view (drag the row by selecting multiple rows) and printing these users name through Business RUle. The script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 04:32 AM
ideally the BR should run 5 times for 5 different updates or users
Did you try doing for 2 records?
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-21-2025 04:34 AM
the BR should run 5 times and print 5 different times
How many times the BR log is printing?
where is the line which prints the sysId in logs?
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-21-2025 04:44 AM
Hi @Deepa12
Business Rule script is executes for each deactivated user, and the user’s name will be printed in the System Logs (accessible via System Logs > All).
You can List Action, If you want to deactivate users in bulk and trigger the printing of their names without manually selecting each user.
In list view of user table, choose Personalize List > Create List Action.
script in List action:
(function execute(inputs, outputs) {
var users = inputs.records;
for (var i = 0; i < users.length; i++) {
var user = users[i];
user.active = false;
user.update();
gs.info('User deactivated: ' + user.name);
}
})(inputs, outputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 06:03 AM
Hi @Deepa12 ,
change it from BR to Client Script with "Type" onCellEdit()
You have all selected sys_ids available, react on changed value and display message.
If my answer helped you in any way, please then mark it as helpful and correct. This will help others finding a solution.