how to dot walk in script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 05:12 AM
Hi all,
I'm little bit confused, like how to link the fields from 2 different tables.
Ex: sys_user & cmn_location. In user table i can able to see city & country fields but the field names are populating as location for both. In this case I want to get those particular 2 fields from location table. How I do that in script include?
Sys_user > city want to get from cmn_location > city
Need some detailed understanding. Your inputs helps me to do this thing.
Regards,
Sweety.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 05:53 AM
Hello sourab,
It's not working. Can you suggest me the alternate ways to do it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 05:54 AM
Try this:
var displaydetails = Class.create();
displaydetails.prototype = Object.extendsObject(AbstractAjaxProcessor, {
details: function() {
var user = this.getparameter('sysparm_select');
var obj = {};
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', user);
gr.query();
if (gr.next) {
obj.ucity = gr.location.city, // in place of city what is the field name have to pass
obj.ucountry = gr.location.country; // same for country too
}
return JSON.stringify(obj);
}
},
type: 'displaydetails'
});
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 06:11 AM
Hey Aman,
I have tried it, It's not working for me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 06:27 AM
Can you show user form, how location is populated on user form
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 06:36 AM