Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get column datatype from glideElement?

Pradnya6
Giga Contributor

In a script include I want to get the column datatype.
var gr = new GlideRecord('cmdb_ci_solaris_server');
gr.setLimit(20);
gr.query();
if (gr.next())
{
var ele = gr.getElement('name');
}

from the above code I get the glideElement. Is there any method which will return the datatype (Internal_Type) of the column?

5 REPLIES 5

adiddigi
Tera Guru

Why don't you query sys_dictionary for the table and particular column to get the data type? There may be a method to get the internal type too, I am not too sure.


Chris_Hann
ServiceNow Employee
ServiceNow Employee

It worked ... values can be retrieved using following functions.
var val = gr.getElement('u_parent').getED();
var Reference = val.getReference();
var ReferenceQual = val.getReferenceQualifier();


Thanks Chris!