Sai Shravan
Mega Sage

Hi @Ryax1 ,

 

The issue is happening because the "location" field on the "sn_agent_cmdb_ci_agent" table is a reference field.

 

var svs = new GlideRecord("sn_agent_cmdb_ci_agent");
svs.addQuery('agent_extended_info.cmdb_ci.sys_class_name', 'cmdb_ci_computer');
svs.query();
while (svs.next()) {
    var loc = new GlideRecord('cmn_location');
    loc.get(svs.location.sys_id);
    gs.print(loc.getDisplayValue());
}

 

Regards,
Shravan
If my answer solved your issue, please mark my answer as Correct & Helpful

Regards,
Shravan
Please mark this as helpful and correct answer, if this helps you