Skip to content
gflewis edited this page Apr 26, 2015 · 1 revision

The goals in implementing this Perl module were as follows.

  • Provide an easy to use and performative method for querying large tables. Please refer to examples below of Query objects.

  • Make it even more simple. Eliminate unnecessary curly brackets. The core functions should adhere as closely as possible to ServiceNow's wiki documentation for the Direct Web Service API (http://wiki.servicenow.com/index.php?title=SOAP_Direct_Web_Service_API). Extended functionality is placed separate functions.

  • Leverage lists. If you are using the Web Services API to access ServiceNow, you will frequently find yourself dealing with lists of sys_ids. Since Perl is particularly good at dealing with lists, we should surface that opportunity. The getKeys method here returns a list of keys (not a comma delimited string). Methods are provided which allow a list of records to be easily retrieved based on a list of keys.

    By the way, throughout this document I will frequently use key as a synonym for sys_id.

  • Make the functions intelligent where it is easy to do so.

    In this example the first syntax can be distinguished from the second because we assume that a single parameter must be an encoded query.

    @recs = $server_tbl->getRecord("operational_status=1^virtual=false");
    @recs = $server_tbl->getRecord(operational_status => 1, virtual => "false");
    
  • Provide good documentation with lots of examples. You are reading it now. I hope you agree that this goal has been met.

Clone this wiki locally