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

Slava Savitsky
Giga Sage

This is how you can get a column's internal type:



var type = gr.getElement('name').getED().getInternalType();