Reference Qualifier to filter Users with HR Profiles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2020 11:39 PM
How should look like reference qualifier for User table reference field [sys_user] to filter only users with HR Profiles [sn_hr_core_profile]? This is for record producer in standard Service Portal, not in ESC (ESC does not exist).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2020 11:43 PM
Hi,
so you want to show only those users in user reference variable who have HR profile?
for this you would require advanced ref qualifier and script include
something like this
javascript: new getRecords().getUsers();
Script Include:
var getRecords = Class.create();
getRecords.prototype = {
initialize: function() {
},
getUsers: function(){
var arr = [];
var hrRec = new GlideRecord('sn_hr_core_profile');
hrRec.addNotNullQuery('user');
hrRec.query();
while(hrRec.next()){
arr.push(hrRec.user.toString());
}
return 'sys_idIN' + arr.join();
},
type: 'getRecords'
};
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 09:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 09:10 PM
Hi,
call the script include name with the complete API name and not just name
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2021 07:54 AM
Thank you Ankur that is now working as expected