Service...deRecord(3)

πŸ“¦
version 1.01 Β· 2 versions
, in fedora 43

πŸ¦‹ Service...deRecord(3) β€” the GlideRecord module, bestie edition

okay so this is a page from the User Contributed Perl Documentation, and it's literally all about the GlideRecord module β€” the Service-now Perl API - GlideRecord perl module. it's giving "object representation" energy, and we're about to unpack every single crumb. πŸ’–


✨ GlideRecord module ✨

An object representation of a GlideRecord object used to access your Service-now instance. yes, a GlideRecord that represents a GlideRecord. recursion? in my manpage? it's more likely than you think. πŸŒ€


πŸŽ€ System Requirements πŸŽ€

The Service-now Perl API requires Perl 5.8 with the following modules installed β€” no skipping, bestie, the vibe check is mandatory:


🌸 Constructor 🌸

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 you're creating a Class that inherits GlideRecord (See any class in ServiceNow/ITIL for example). so like, if you're doing the inheritance thing, that caller object is not optional, periodt. πŸ’…


🫢 Subrotines 🫢

(that's the original spelling, I'm not fixing it, I'm just respecting the source material πŸ₯°)

insert πŸ’Œ

insert(optional hash argument)

Example:

$glideRecord->insert();

Inserts glide record into Table. Returns sys id. boom. done. iconic.

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. so like... it's a pending glow-up, not a real one yet. πŸ’…

addQuery πŸ”

addQuery(name, value)

Example:

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

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

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. one at a time, no rushing, we walk. πŸšΆβ€β™€οΈ

next ⏭️

next()

Example:

    if($glideRecord->next())
    while($glideRecord->next())

Steps through the results of Glide Record query. Returns TRUE if more elements exist. and FALSE when the well runs dry, fr fr. 😭

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. so bestie β€” if you never update or insert, your changes are just ✨thoughts and prayers✨.

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. it's giving "human-readable" realness. πŸ‘‘


πŸ’– okay bestie that's literally the whole page β€” every flag, every example, every crumb. go forth and query. πŸ¦‹

this page was served up by perl v5.42.0, dated 2025-07-25 β€” and yes, Service...deRecord(3) really is the name, the dots are on purpose, they ate. πŸ’…πŸŽ€

πŸ“¦ where this page comes from