- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 06:53 AM
How to write background script that will give you list of user whose location is empty.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 11:28 PM
Hello @kusumgautam
Please find the below background script to get the list of users whose location is empty.
var userGr = new GlideRecord('sys_user');
userGr.addQuery('location', '');
userGr.query();
var totalCount = 0;
while (userGr.next()) {
gs.print('User with empty location: ' + userGr.getValue('name'));
totalCount ++;
}
gs.print('Total Count of users with empty location: ' + totalCount);
Please mark my answer helpful and correct if I have answered your question.
Thanks & Regards,
Aniket.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 10:59 PM
Hi write this code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 11:21 PM
Hi,
You can refer this below script
Thanks
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 11:28 PM
Hello @kusumgautam
Please find the below background script to get the list of users whose location is empty.
var userGr = new GlideRecord('sys_user');
userGr.addQuery('location', '');
userGr.query();
var totalCount = 0;
while (userGr.next()) {
gs.print('User with empty location: ' + userGr.getValue('name'));
totalCount ++;
}
gs.print('Total Count of users with empty location: ' + totalCount);
Please mark my answer helpful and correct if I have answered your question.
Thanks & Regards,
Aniket.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 04:59 AM
You can use below script:
Please mark my answer helpful and accept as a solution if it helped 👍✔️
Kavita Bhojane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 10:46 AM
I got The solution than you for the help.