Show only required fields in GlideModal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2018 02:02 AM
Hi All,
I am using the below code to show the User data in Popup window, but I am getting all the fields that are present in "User" table list view (i.e. User ID, Name, Email, Active, Created and Updated fields). But I want only 3 fields to be shown in Popup Window (i.e. User ID, Name and Email fields).
Is there some issue with the below line :
gdw.setPreference('sysparm_fields', 'user_name,name,email');
function getUsersPopUp(usersId, popUpTitle) {
try {
var title = 'Show User Data';
var query = 'emailIN' + usersId;
var gdw = new GlideModal('show_list');
gdw.setTitle(title);
gdw.setSize(750);
gdw.setPreference('table', 'sys_user_list');
gdw.setPreference('sysparm_query', query);
gdw.setPreference('sysparm_fields', 'user_name,name,email');
gdw.setPreference('title', 'A New Title');
gdw.render();
} catch (e) {
jslog('error showing Not Sent Users');
jslog(e);
}
}
Can anyone please let me know how can I show only the required fields in GlideModal, instead of showing all the fields present in User table list. I don't want to configure list layout for User table for this.
Thanks,
Mahendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2018 07:00 AM
Hi Mahendra,
When you open the dialog window and have table in it it uses default list view. you can specify your own view by giving this line.
gdw.setPreference('sysparm_view','<viewName>');
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
‎05-31-2018 06:05 AM
Hi Mahendra,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
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
‎06-06-2018 05:20 AM
Hi Mahendra,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
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
‎11-16-2023 05:15 AM
Hi Ankur
Is it possible to show two fields in GlideModal?
Thanks