OOTB "Data table" widget will be stuck in "Loading.." Slow query running on the Approval table sysapproval_approverDescriptionIf a large number of Approvals are being created for non-task type tables then a slow query can occur when viewing sc_req_item records through the Service Portal "Data Table" widget or a clone of that widget.Steps to Reproduce Log in as adminElevate to security adminCreate an ACL on the sc_req_item.request field that has a role requirement "admin"Create a user with the roles "itil" and "catalog admin" and copy that user's sys_idOrder at least one Catalog Item and approve the Request (sc_request) so that the workflow on the related sc_req_item gets attached.Click "Debug SQL" and "Debug Security" from the left navOpen "Scripts - Background"Run the following script, substituting the appropriate sys_id'sNotice in the ACL logs that the ACL blocked access to the sc_req_item.request fieldNotice in the SQL logs that an invalid query was generated. // Impersonate uservar userSysId = "5137153cc611227c000bbd1bd8cd2005"; // sys_id of the user from step #4var myId = gs.getSession().impersonate(userSysId);try { // Everything from here to "De-impersonate" will be executed in the context of the user gs.print("Running as " + gs.getUserName() + "..."); gs.print(gs.getSession().getEncryptionContext().getSysIds()); var data = { fields: ["number", "stage"] }; var record = {}; var secGr = new GlideRecordSecure("sc_req_item"); secGr.addQuery("sys_id", "IN", ["62af9eeadbddc810caad9db2ca9619a1", "4d13dae2dbddc810caad9db2ca96193f"]); //sys_id of the request item from step #5 //secGr.addActiveQuery(); secGr.query(); while (secGr._next()) { gs.print([secGr.sys_id, secGr.number, secGr.getDisplayValue("stage")].join(" ")); new GlideSPScriptable().getRecordElements(record, secGr, data.fields); gs.print(JSON.stringify(record)); }} catch (e) { gs.print("Error during impersonation: " + e);} finally { // De-impersonate gs.getSession().impersonate(myId); gs.print("...running as " + gs.getUserName());} WorkaroundThis issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In or Intended Fix Version fields to determine whether any versions have a planned or permanent fix. Related Problem: PRB1376537