Skip to main content

Posts

ServiceNow search for ACL by role

Recent posts

ServiceNow getMD5Hex function

  getMD5Hex  is a function commonly found in utility libraries (such as Apache Commons Codec) that  calculates the  MD5 hash  of data (like a string or file) and returns the result as a 32-character hexadecimal string  Example: var sname = 'Joe Bloggs'; var value = new GlideDigest().getMD5Hex(sname.toLowerCase()); gs.info ('result==='+value); ServiceNow

Why objects can’t upgrade (ServiceNow)

ServiceNow unable to revert an object to baseline during an upgrade - presented with an error When a hotfix was provided on a protected script for example look at the hotfix update set to check if the Replace on upgrade flag is set to true for that file in the update set?  If it is set to false it can cause this issue.  If it is false change the flag in the update set to true which should allow the file to be reverted to the baseline, release version. Just setting the flag in the already-applied update set seems to do the trick --- Additional info (via ServiceNow Support): vSOLUTION PROPOSED:  After analysing the logs at the time of the upgrade,  we saw that the objects was loaded but the version was not added since it is a duplicate of the latest existing ones. Example for sys_script_include_d026e995472f95d4207ddfbd436d43cf : 2026-03-19 23:07:23 (694) worker.1 worker.1 txid=e862f2ec87fb ESLatestScriptLoader Skipping sys_es_latest_script record because there is an ex...

ServiceNow Executing a Flow Action via Script (Async and Sync)

 ServiceNow Executing a Flow Action via Script (Async and Sync) Diff between asynch v synch   //-- Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.                   //-- sn_fd.FlowAPI.getRunner().action('global.glidepath__create_sso'). inBackground ().withInputs(inputs).run();                     //-- Execute Synchronously: Run in foreground. Code snippet has access to outputs.                   var   result = sn_fd. FlowAPI .getRunner().action( 'global.glidepath__create_action' ). inForeground ().withInputs(inputs).run();                   var   outputs = result.getOutputs();     ...

ServiceNow Error when copying flow: "Label cache error: Table not found"

ServiceNow Error when copying flow Label cache error: Table not found: x_cls_clear_skye_i_identity_settings: Label cache error: Table not found: x_cls_clear_skye_i_identity_settingswhen copying the promote profile subflowreproduceable on 5.2 and 3 KB1575415 - How To Remove Unnecessary Label Cache Entries of a Flow/Subflow/Action 11:43 Apparently, running the background script detailed in the SN KB should resolve the issue once happy, modify the fix script below to set debugmode to false --- Fix script: // README // This script updates and removes unnecessary label cache entries of a flow/subflow (defintion and master snapshot). // // IMPORTANT NOTES:  // This script only deletes the unnecessary label cache in the server. UI can hold a copy of a label cache. // Therefore refresh the browser that has the action opened once this script is executed for the action. // If this script is executed and the action is saved using UI, the previous label cache (before the delete) // will be sa...