Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Perl API GlideRecord

Perl API GlideRecord

ServiceNow Perl API - GlideRecord perl module is an object representation of a GlideRecord object used to access your ServiceNow instance.

Constructor

Constructor Description
new

new(Configuration object, Table name, optional caller object)

$config = ServiceNow::Configuration->new();
$glideRecord = ServiceNow::GlideRecord->new($config,'incident',$me);        

Constructor. Access to the ServiceNow Glide Record object. The caller object is optional unless creating a Class that inherits GlideRecord (See any class in ServiceNow/ITIL for example).

Subroutines

Subroutines Description
insert

insert(optional hash argument)

Example:

$glideRecord->insert();

Inserts glide record into Table. Returns sys id.

setValue

setValue(name, value)

Example:

$glideRecord->setValue('caller_id','56');

Sets element within Glide Record with name to specified value. Will not effect the GlideRecord within the Table until inserted or updated.

addQuery

addQuery(name, value)

Example:

$glideRecord->addQuery('number','INC1000014');
$glideRecord->query(); 

Refines query to include only the Glide Records with field name=value.

query

query(optional hash arguments)

Example:

$glideRecord->query();

Returns all Glide Records in the Table with specified query. Step through the Records with the next() call.

next

next()

Example:

if($glideRecord->next());

while($glideRecord->next());

Steps through the results of Glide Record query. Returns TRUE if more elements exist.

update

update(optional hash arguments)

Example:

$glideRecord->setValue('name','value');
$glideRecord->update();

Updates Glide Record in table with the Glide Record object. Changes to Glide Record object will not take effect until updated or inserted. Returns sys_id of record on success, undef of failure.

getValue

getValue(name)

Example:

$glideRecord->getValue($name);

Get value of element name in GlideRecord. Returns string value of element.

getDisplayValue

getDisplayValue(name)

Example:

$glideRecord->getDisplayValue($name);

Gets display value of element name in GlideRecord. A display value would be the string name, instead of the sys_id in the case of a reference field, or the string value instead of the number value in the case of choice fields.

Changes to site functionality will be made starting around 6am on January 21st (Pacific Time) and lasting approximately 6 hours.  The site may be intermittently unavailable.