Skip to main content

Posts

Showing posts from October, 2023

ServiceNow Workflows: Give a workflow a nudge from business rule

 ServiceNow Workflows: Give a workflow a nudge from business rule This is an example of how to "nudge" a workflow to ensure a wait for condition is re-evaluated (e.g. scripted wait for with a GlideRecord) as an alternative to broadcast event to workflow where you want to steer clear of events // Give the workflow a nudge to re-evaluate its Wait for condition var req = new GlideRecord ( 'task' ); if ( req . get ( current . parent )) { var wf = new global . Workflow (). getRunningFlows ( req ); while ( wf . next ()) { new global . Workflow (). broadcastEvent ( wf . sys_id , 'update' ); } }

ServiceNow Flow Designer Tables

 ServiceNow Flow Designer Tables Flow - sys_hub_flow Sub Flows - sys_hub_flow Actions - sys_hub_action_type_definition Steps - sys_hub_step_instance Both Flow and Sub Flows are stored in Same table and the Flow Type field helps to distinguish whether it is Flow or Sub Flow https://www.servicenow.com/community/developer-forum/flow-designer-flows-subflows-actions-storage-table/m-p/1454741 https://www.servicenow.com/community/now-platform-forum/where-are-values-for-flow-designer-step-instances-stored/m-p/1053034

ServiceNow SimpleList Widget Vulnerability

 ServiceNow SimpleList Widget Vulnerability Link:  https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1553688 recent vulnerability affecting the ServiceNow service portal widget called SimpleList from an ethical hacker who posted on a blog. This vulnerability effects public Service Portal pages using the SimpleList widget where the SimpleList points to tables that have empty ACLs. If you have the High Security plug-in or have IP filtering, the vulnerability doesn’t apply. For more information, see the attached communication , have received from ServiceNow and ensure you review  this KB .  we noticed that: ServiceNow’s operational team has made updates to the platform a mitigate the issue. You can view the relevant changes by updating this link with your own ServiceNow instance name: [Instance Name]. service-now.com/sys_security_acl_list.do?sysparm_query=sys_scope%3Dc026625edb28a200c089f100cf96199a%5Esys_updated_by%3Dsystem%40snc.maint%2Cadmin...

ServiceNow try-catch error message

 ServiceNow try-catch error message I've often done it this way: try { }} catch ( ex ) { var message = ex . toString (); gs . error ( 'ERROR is script xyz::' + message ); } But can try it this way also: try { }} catch ( ex ) { var message = ex . getMessage (); gs . error ( 'ERROR is script xyz::' + message ); }

ServiceNow Generate Catalog Tasks in Pending State

 ServiceNow Generate Catalog Tasks in Pending State (classic workflow) this can be achieved by using an Generate activities block, in this screenshot example the 2nd task will remain pending until the first task is closed

ServiceNow Good Performance and Monitoring Links

 ServiceNow Good Performance and Monitoring Links See the following ServiceNow Knowledge Articles: KB0517282 - Troubleshooting general performance issues on all applications KB0517241 - Troubleshooting Slow Performance KB0952746 - Recommendations for Optimal Instance Performance KB0829067 - Performance Resource Page support.servicenow.com Troubleshooting general performance issues on all applications - Support and Troubleshooting - Now Support Portal When users report general performance issues, slowness, or interrupted access on all applications, there are a number of possible symptoms: Transactions take longer than expected. Unable to connect to support.servicenow.com Troubleshooting Slow Performance - Support and Troubleshooting - Now Support Portal Symptoms Unable to log in to an instance. The instance no longer responds to keyboard or mouse commands. Operations seem to run slow or slower than they did before. Slow performance across all or specific support.servicenow.com...

ServiceNow Javascript substr deprecated

 ServiceNow Javascript substr deprecated (Vancouver version) var password='hodljdsnw340949'; var len=9; I would be inclined to replace this:     return password. substr (0, len); with:     return password. substring (0, len); or alternatively use a regex ( var sRegexQ='/^.{'+ len +'}/' var pattern= new SNC.Regex(sRegexQ); var result = pattern.match(password); return(result); )

ServiceNow Generate a Password Function

ServiceNow Generate a Password Function e.g. use for AD pwd var spassword = generatePassword ( 10 ); gs . print ( spassword ); function generatePassword ( len ) { var length = ( len ) ? ( len ) : ( 10 ); var string = "abcdefghijklmnopqrstuvwxyz" ; //to upper var numeric = '0123456789' ; var punctuation = '!@#$%^&*' ; var password = "" ; var character = "" ; var crunch = true ; while ( password . length < length ) { entity1 = Math . ceil ( string . length * Math . random () * Math . random ()); entity2 = Math . ceil ( numeric . length * Math . random () * Math . random ()); entity3 = Math . ceil ( punctuation . length * Math . random () * Math . random ()); hold = string . charAt ( entity1 ); hold = ( password . length % 2 == 0 ) ? ( hold . toUpperCase ()) : ( ho...

ServiceNow set the auto flush value for a particular table

 ServiceNow set the auto flush value for a particular table go to  sys_auto_flush.list and locate the table in question, then set the value to the desired value example:

ServiceNow Where Is Workflow Max Activity Count Defined?

 ServiceNow Where Is Workflow Max Activity Count Defined? under workflow properties> activities