Scoped GlideRecord - getElement(String columnName)

Retrieves the GlideElement object for the specified field.

Table 1. Parameters
Name Type Description
columnName String Name of the column to get the element from.
Table 2. Returns
Type Description
GlideElement The GlideElement for the specified column of the current record.
var elementName = 'short_description'; 
var gr = new GlideRecord('incident'); 
gr.initialize(); 
gr.setValue(elementName, "My DB is not working");
gr.insert();
gs.info(gr.getElement('short_description'));

Output: