Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Filter table based in array from system property

Not applicable

Hi ,

we have set many system properties which contains table names comma separated.

 

Example: hard.ci.pop 

Nisha30_0-1751290238016.png

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

 

1 ACCEPTED SOLUTION

Hi @Community Alums ,

 

 

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

 

 

 

View solution in original post

23 REPLIES 23

Not applicable

HI @thomaskennedy 

yes i am trying to get the Table names and records from those table should only show in CI field.

Thanks

@Community Alums 

I believe I already answered your original question and subsequent questions.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Chaitanya ILCR
Giga Patron

Hi @Community Alums ,

 

try updating the script include script as

getTableNames: function(chkcategory) {
    chkcategory = chkcategory.toString().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

Not applicable

Hi @Chaitanya ILCR 

tried above but not working. Is the Dictionary able to call the SI not sure.

 

Nisha30_0-1751364751134.png

Nisha30_1-1751364807312.png

 

Thanks

@Community Alums 

did you compare correct category value?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader