Check if a table exists in a server-side script

var gr = new GlideRecord('incident');;

var anotherGr = new GlideRecord('incidentZ');;!/api_doc?v=jakarta&id=r_ScopedGlideRecordIsValid 


another option:
var table = new TableUtils("cmdb_ci_computer");
gs.print("Does 'my_table' exist? " + table.tableExists()); //--returns true

var table = new TableUtils("cmdb_ci_computerZ");
gs.print("Does 'my_table' exist? " + table.tableExists()); //--returns false


Popular posts from this blog

GlideRecord setValue

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy