Quick Guide: New York

Here’s my take of whats new with New York

Depricated things

  • Processors-Listed under changes
    • Note: This feature is deprecated. While legacy, custom processors will continue to be supported, creating new custom processors has been deprecated. Instead, please use the Scripted REST APIs. The following information is left in the documentation for existing processors only.
    • You can still create them, so it’s just a recommendation
  • Mid server property mid.download.through.instance
    • In previous releases, this property was set to true to force all MID Servers to upgrade through the instance and was configurable by customers. In the New York release, auto-upgrades are performed by the MID Server host computer and not by the instance. To implement this behavior, the default value of this property was changed to false, and the property was concealed to protect the setting. DO NOT change the value of this property.

Updated things

  • Multi-row variable set
    • When you clone a request that contains a multi-row variable set, the information that is specified in the multi-row variable set is available in all cloned requests.
    • A multi-row variable set is now visible in the variable summarizer in Service Portal.
    • Set a limit to the number of rows that you can add to a multi-row variable set by using the max_rows attribute in the Variable Set attributes field.

New things

  • Remote Tables

    • Retrieve external data using remote tables and scripts

      • retrieve the data from external sources or from another instance with REST or SOAP services. The external data lives in the memory in read-only mode, which makes the data temporary, or transient, within the Now Platform. You can then view and manipulate the external data without importing or storing it.
      • Plugin: “Remote Tables” or “com.glide.script.vtable” 2019-07-26-new-york-remote-tables-1.png
      • Recomended limit is 1000 records
      • example use cases;
        • weather-related data that appears on a homepage when a user logs in.
        • customer details that are stored in an external Customer Relationship Management
        • personnel data from Human Capital Management
      • Example working script;

        (function executeQuery(v_table, v_query) {
            try {
                // https://randomuser.me/api/
                var requestBody = {};
                var restMessage = new sn_ws.RESTMessageV2();
                restMessage.setHttpMethod("get");
                restMessage.setEndpoint("https://randomuser.me/api/?results=1000&seed=foobar");
                restMessage.setRequestBody(JSON.stringify(requestBody));
                var response = restMessage.execute();
                var error = response.haveError();
                if (error) {
                    var errorCode = response.getErrorCode();
                    var errorMsg = response.getErrorMessage();
                    gs.info(errorCode);
                    gs.info(errorMsg);
                } else {
                    var headerVal = response.getHeader("Content-Type");
                    var headers = response.getHeaders();
                    var queryString = response.getQueryString();
                    var statusCode = response.getStatusCode();
                    var responseBody = response.getBody();
                    var responseObj = JSON.parse(responseBody);
                    var responseObjLen = responseObj.results.length;
                                
                    responseObj.results.forEach(function (result) {
                        var obj = result;
                        gs.info('adding row/email: ' + result.email);
                        v_table.addRow({
                            //seems you need to map field: payload result
                            sys_id: result.login.md5,
                            u_email: result.email
                        });
                    });
                }
            } catch (ex) {
                v_query.setLastErrorMessage(ex.message);
                return;
            }
            // Main API:
            //    v_table.addRow({ ... }) - adds a row to the result set
        
            // There are also query helper methods
            //    v_query.getEncodedQuery() - returns encoded querystring
            //    v_query.getCondition(field) - returns encoded querystring for the given field (includes field name, operator, and value)
            //    v_query.getParameter(field) - returns parameter for the given field (only includes value for equality conditions)
            //    v_query.isGet() - returns whether the query is a single get by sys_id
            //    v_query.getSysId() - returns parameter for sys_id field
            //    v_query.isTextSearch() - returns whether the query contains a text query parameter
            //    v_query.getTextSearch() - returns text search query parameter (internal field name 123TEXTQUERY321)
            //    v_query.getFirstRowWanted() - returns the first row to include
            //    v_query.getLastRowWanted() - returns the last row to include
        
            // Note: You must define sys_id for each row so that forms and lists for this table work properly
        
            // Your code goes here
            // v_table.addRow({...})
        })(v_table, v_query);
        
  • System Clone

  • Delegated development and deployment

    • Manage Update sets - Grant non-admin users permission to manage local and retrieved update sets. Allow users to create, update, and delete local update sets as well as preview, resolve conflicts, and commit retrieved update sets.

Further Reading:

Edit this page

Avatar
Jace Benson
ServiceNow Developer

ServiceNow is my day job, JAMStack is my passion.