GlideRecordUtil - populateFromGR(Object hashMap, GlideRecord gr, Object ignore)

Populates the given hashmap from the given GlideRecord instance. Each field in the GlideRecord becomes a property in the hashmap.

Table 1. Parameters
Name Type Description
hashMap Object An object being used as a hashmap.
gr GlideRecord A GlideRecord instance positioned to a valid record.
ignore Object An optional hashmap of file names not to populate.
Table 2. Returns
Type Description

var objectToPopulate = {};
var gr = new GlideRecordUtil().getGR("cmdb_ci_computer", "2dfd7c8437201000deeabfc8bcbe5d56");
var ignore = {"sys_created_on": true, "sys_updated_by": true};
new GlideRecordUtil().populateFromGR(objectToPopulate, gr, ignore);
// Now the objectToPopulate contains field/value pairs from the computer GlideRecord