Populate variable dynamically servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2024 05:51 PM
Hello developers, can you please help me on how to populate lookup select box/select box dynamically from the answer i get from script include .Any help is appreciated. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2024 06:28 PM - edited ‎01-26-2024 06:29 PM
@servicenow14710 : Please refer to the article below. This can serve as a guide to start with. Its well articulated with the step-by-step instructions.
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2024 06:45 PM
Hello @Sainath N : Thanks for your response I am facing concern populating lookup select box/select box i could response properly but need help on populating . Thanks !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2024 06:49 PM
@servicenow14710 Could you please post the code which you are trying. I will suggest the changes accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2024 05:58 AM
Hi @Sandeep Rajput : I used similar code , but it return sys id of table. I need to populate/override table columns with filter we get from glide record similar to how we give reference qualifier to table. Thanks!
var SampleUtils = Class.create();
SampleUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getSomeResponse: function(){
var tblGr = new GlideRecord('Table_name');
tblGr.addEncodedQuery('Some_Query');
tblGr.query();
var response = []; //An array to store all sys_ids from the query
while(tblGr._next()){
response.push(tblGr.getUniqueValue()); //Insert the sys_id into the array
}
return response.join(','); //Return the array as comma seperated string
},
type: 'SampleUtils'
});