- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 06:32 AM
Hi ,
we have set many system properties which contains table names comma separated.
Example: hard.ci.pop
1)need to call this property from Script Include
2) the result of this should be : 'Configuration Item' field should display records only from these tables.
How do I achieve this
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 04:23 AM
Hi @Nisha30 ,
in the question you have share the property screenshot value contains ";" at the end
remove the ";" at the end of the property value in the system property
update the ref qual as below
javascript: "sys_class_nameIN" + new global.getincTables().getTableNames(current.getValue('category'));
update/keep the script include method as below
getTableNames: function(chkcategory) {
chkcategory = chkcategory.toLowerCase();
if (chkcategory == 'hardware')
return gs.getProperty('inc.filter.hardware');
else if (chkcategory == 'software')
return gs.getProperty('inc.filter.software')
else if (chkcategory == 'exchange')
return gs.getProperty('inc.filter.exchange')
else
return ''
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 07:41 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-30-2025 07:43 AM
yeah have Script include but not working below is the SI function
and the dictionary
getTableNames: function(chkcategory) { var arr = []; if(chkcategory == 'Hardware') { var hardTable = gs.getProperty('inc.filter.hardware'); arr.push('sys_id'); return arr; } if(chkcategory == 'Software') { var softTable = gs.getProperty('inc.filter.software'); arr.push('sys_id'); return arr; } if(chkcategory == 'Exchange') { var hardTable = gs.getProperty('inc.filter.exchange'); arr.push('sys_id'); return arr; } }, |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 09:13 AM
try this
I assume you are comparing correct category value
advanced ref qualifier as this
javascript: "sys_class_nameIN" + new incUtils().getTableNames(current.category);
getTableNames: function(chkcategory) {
var arr = [];
var propertyValue = '';
if (chkcategory == 'Hardware') {
propertyValue = gs.getProperty('inc.filter.hardware');
}
if (chkcategory == 'Software') {
propertyValue = gs.getProperty('inc.filter.software');
}
if (chkcategory == 'Exchange') {
propertyValuehardTable = gs.getProperty('inc.filter.exchange');
}
return propertyValue;
},
I believe I already answered your question and you can enhance it based on your requirement and your development skills.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 03:46 AM
tried the above code . I put logs and it gives the value in logs i can see,
however the Configuration Item field is not populated with records related to that table. its empty as in snap shot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 03:48 AM - edited 07-01-2025 03:55 AM
I believe issue is with the category value not getting fetched as it's a new record.
Also did you create/update the OOTB dictionary override for CI field as it's at task level
print category value in logs
getTableNames: function(chkcategory) {
gs.info(chkcategory); // if this doesn't give you the value then it won't work
var arr = [];
var propertyValue = '';
if (chkcategory == 'Hardware') {
propertyValue = gs.getProperty('inc.filter.hardware');
}
if (chkcategory == 'Software') {
propertyValue = gs.getProperty('inc.filter.software');
}
if (chkcategory == 'Exchange') {
propertyValuehardTable = gs.getProperty('inc.filter.exchange');
}
return propertyValue;
},
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader