NullPointerException in OOTB Simple List widget after San Diego upgradeDescriptionSimple List Widget in service portal is throwing null pointer exception for sc_req_item table in the San Diego release. This is occurring because of the 'Stage' field is included in a list layout and a user doesn't have required read access. As a result the widget throws an error below: java.lang.NullPointerException Script source code logged to console Failing widget: 'Data Table' (5001b062d7101200b0b044580e6103eb)Steps to Reproduce 1.Open any OOB San Diego Instance2.Create a page in service portal for sc_req_item using simple list widget with stage as one of the fields3.Impersonate ITIL user and load the simple list. Result: Null pointer exception is seen. 4.Remove the stage field in display options from instance actions and load the simple list again it will load fine for ITIL userOccurs for non-admin users, admins are able to access the simple list fine.WorkaroundPerform one of the following for the workaround:A) Add an ACL that grants read access to the wf_workflow table and field-level ACL on the sc_cat_item.workflow for the affected users. operation: readname: wf_workflowrequires roles: <a related role of the affected user> operation: readname: sc_cat_item.workflowrequires roles: <a related role of the affected user> OR B) Remove the "stage" field from the fields being displayed by the widget. If it's a "Simple List" impacted perform the actions below: Go to the sp_instance_vlist record of the widgetClick on the "Heading Glyph, Color, Sizing" tabNavigate to the "Additional options, JSON format" field and search for the "secondary_fields" attributeRemove "stage" fieldNote: Alternatively, the "Simple List" can also have "Stage" populated in "Fields on List, Appearance" under "Display field" which would need to be removed. If it's a "Data Table from Instance Definition" impacted perform the actions below: Go to the sp_instance_table record of the widgetClick on the "Table, Filter & Fields" tabUnder "Fields", unlock and remove the "Stage" field from the list view ---- For a list of impacted widgets, run the script below in global scope which returns a URL for you to analyze: ---- var WIDGET_TYPES={ "Simple List": "sp_instance_vlist", "Data Table From Instance Definition" : "sp_instance_table"};var TABLES_WITH_STAGES = getPossibleTables();var found=[]; for (var type in WIDGET_TYPES) { var wi = getWidgetInstances(type, WIDGET_TYPES[type]); while (wi.next()){ if (usesStageDisplayValue(wi)) { gs.print(type +" : " + wi.title + " : " + wi.getUniqueValue()); found.push(wi.getUniqueValue()); } }}gs.print("");gs.print("sys_ids for a query");gs.print("/sp_instance_list.do?sysparm_query=sys_idIN" + found.join(','));function usesStageDisplayValue(wi) { var tableName = wi.table; //Simple List widget's "display_field" if (checkField(tableName, wi.display_field)) { return true; } //DataTable widget's "field_list" if (checkFieldList(tableName, wi.field_list)) { return true; } //SimpleList's "secondary_fields" json var json=JSON.parse(wi.widget_parameters); var secondaryFields = json.secondary_fields.displayValue; if (checkFieldList(tableName, secondaryFields)) { return true; } //nothing seems to use a stage field return false;} function checkFieldList(tableName, fieldList) { var aFlds = fieldList.split(","); for (var i in aFlds) { if (checkField(tableName, aFlds[i])) { return true; } } }function checkField(tableName, fieldName) { try { var type = GlideTableDescriptor.get(tableName).getElementDescriptor(fieldName).getInternalType(); var isWorkflow = "workflow".equals(type); // gs.print(tableName +"." + fieldName + "=>" + isWorkflow ); return isWorkflow; } catch (e) { //an error in the widget config = no match return false; }}function getWidgetInstances(wiType, wiTable) { var gr = new GlideRecord(wiTable); gr.addQuery("sp_widget.name", wiType); gr.addQuery("table", "IN", TABLES_WITH_STAGES); gr.query(); return gr;}function getPossibleTables() { var gr = new GlideRecord("sys_dictionary"); gr.addQuery("internal_type", "workflow"); gr.query(); var tables = []; while (gr.next()) { var tableName = gr.getValue("name"); if (!tables.includes(tableName)) { tables.push(tableName); } } return tables;} ---- Reviewing the results of the script: The script outputs a list of the widgets that need to be reviewed. Example below: *** Script: Simple List : testWidget4 : 6e984a3bdb63c5502ef14cae13961958*** Script: Simple List : testWidget3 : cf532de3c3130110f5bfea1c8d40ddb0*** Script: Simple List : testWidget : e57713fac3130110f5bfea1c8d40dd11*** Script: Data Table From Instance Definition : testDTWidget : 7264ed27c3130110f5bfea1c8d40dd25*** Script: *** Script: sys_ids for a query*** Script: /sp_instance_list.do?sysparm_query=sys_idIN6e984a3bdb63c5502ef14cae13961958,cf532de3c3130110f5bfea1c8d40ddb0,e57713fac3130110f5bfea1c8d40dd11,7264ed27c3130110f5bfea1c8d40dd25 Copy and paste the results from the last line and into your URL bar: https://<instance>.service-now.com/sp_instance_list.do?sysparm_query=sys_idIN6e984a3bdb63c5502ef14cae13961958,cf532de3c3130110f5bfea1c8d40ddb0,e57713fac3130110f5bfea1c8d40dd11,7264ed27c3130110f5bfea1c8d40dd25 In the list that appears, click on the information icon (highlighted in red), review and open each record populated and make adjustments. If there are no results, the script output is observed below as blank and there are no records to be concerned about: *** Script: *** Script: sys_ids for a query*** Script: /sp_instance_list.do?sysparm_query=sys_idINRelated Problem: PRB1563939