Skip to main content

Posts

Showing posts from January, 2023

ServiceNow For-each logic in Flow Designer

  ServiceNow recommends against iterating lists above 1000 records. To iterate lists above 1000 records, break the lists up and utilize separate flows. For more information, see ServiceNow's For Each flow logic documentation . https://docs.servicenow.com/bundle/tokyo-application-development/page/administer/flow-designer/concept/flow-logic-for-each.html  (ServiceNow )

ServiceNow Xplore - Developer Toolkit

Toolkit created by James Neale of Sharelogic You might decide the snutils do the trick just as well, nevertheless an interesting alternative  link: https://developer.servicenow.com/connect.do#!/share/contents/9650888_xplore_developer_toolkit?v=4.13&t=PRODUCT_DETAILS Xplore: Developer Toolkit follow project by   James Neale Latest release: Xplore 4.13 - Nov 09, 2022  Xplore is used by professionals across the world to improve development activities and support for their instances. - Background script alternative - explore server side objects - Client console alternative - explore client side objects - Test and debug code and objects - Built in regular expression testing tool - Built in table explorer - Built in log viewer Full change log:  https://github.com/jneale/Xplore/blob/master/CHANGELOG.md https://xploretoolkit.com (ServiceNow )

ServiceNow GlideRecord: initialize versus newRecord

initialize documentation  >  Creates an empty record within the current GlideRecord that is suitable for population before an insert > i sNewRecord=false before insert, gs.info(gr.Active) is empty before .insert() newRecord documentation  >  Creates a GlideRecord, sets the default values for the fields, and assigns a unique ID to the record > i sNewRecord=true before insert,   gs.info(gr.Active) is populated before .insert() >fairly helpful video link here in a nutshell, isNewRecord() allows you to query values / perform validation before the insert (e.g. if you wanted to include conditions) and populates the records holding the values in memory in the rare case for example you wanted to create/update a related record (e.g. in a custom table) BEFORE the insert operation, newRecord() enables values to be referenced example : var gr=new record ('incident)'; gr.initialize() / gr.newRecord() gs.print(gr.active); gs.print(gr.sys_id); gs.print(gr.n...

ServiceNow SNUtils Slash Commands - example commands

see  https://www.youtube.com/watch?v=mhEQZNy_DX4&t=1s  /code fred > code search commands (in this case search code for 'fred' table search, e.g.      /sys_ux    /xml* (searches all tables containing xml) sys id search: then press enter to load the record navigate to direct page, e.g. /cache.do /incident. gives you switches (remove the dot to navigate back to tables example switch : incidents created on today (hit enter and gives you results) view table structure from within an incident: /tn  > shows technical names on fields (this can also be switched on / off via the snutils cog) /lang es > changes the language in the instance (translates all the fields) /comm event management > searches the community /api   > search developer references /br > inline search > control-command-enter opens up the results in a new tab /spw > service portal widget search some commands directly on the form ctrl S  > sa...

ServiceNow view additional info on flow / subflow tables

 go to flow table:  sys_hub_flow (use flow type column to distinguish between flow/subflow) (it appears that the sys_hub_flow_base table references subflows, as can be seen by the 'subflow' dictionary table on sys_hub_flow_instance  table) this is also a useful reference for additional table names: https://www.servicenow.com/community/developer-forum/flow-designer-flows-subflows-actions-storage-table/m-p/1454741

ServiceNow VS Code Script Synch

more good stuff from Arnood Kooi! https://marketplace.visualstudio.com/items?itemName=arnoudkooicom.sn-scriptsync    - download vscode (link for Mac or Windows ) - grab the util from the marketplace link above - it will open in vscode, click the install button from within there here's the youtube that explains how to use it - should then be visibile from the SNutils cog (see previous posts relating to SNutils) - - (ServiceNow )

ServiceNow SNUtils CheatSheet

  https://www.arnoudkooi.com/cheatsheet/ https://www.youtube.com/watch?v=mhEQZNy_DX4&t=1s

ServiceNow installing SNUtils & Slash Commands

 see https://developer.servicenow.com/blog.do?p=/tags/sn-utils/ and  https://www.youtube.com/watch?v=NJzT3HGTHXQ Steps: - SNUtils is a browser extension to make life easier for admin/developer: search a table, executing functions that normally would take 5 steps> reduce from 5 steps to 1 or 2 steps  Increased productivity - add chrome/firefox SNUtils extension - go to browser extension store or grab it here (Chrome example) (or try arnoudkooi.com , contains the extension for other browsers including on-prem version) Chrome version also works for Brave and other Chromium based browsers - add the extension to your browser - go to your servicenow instance e.g. your PDi - click the chrome extensions icon (little puzzle icon top right of the browser) - from there, pin the extension - looks like this: little cog thingy - you then get the slash commands by entering / in the left hand nav in your instance (may require a browser restart can also enable cool script style in back...

ServiceNow Slack Slash Commands

 see  https://docs.servicenow.com/en-US/bundle/tokyo-it-service-management/page/product/itsm-tcm/reference/slack-commands.html and https://docs.servicenow.com/bundle/tokyo-application-development/page/administer/integrationhub-store-spokes/task/set-up-slack.html

ServiceNow Next UI: theme your instance - QUICK HACKS

note: Utah release brings in  Theme builder  changes which may make below steps unnecessary ServiceNow Next UI: theme your instance - QUICK HACKS to change the header colour: apply it across the board: go to  sys_ux_style and create an entry as follows (give it whatever name you prefer, e.g. 'header UAT': grab your own variant color code from  https://htmlcolorcodes.com/ see below to copy paste code go to now experience framework> themes, create a new theme, and reference the above newly created from UX Theme Styles tab create new system property glide.ui.polaris.theme.custom and copy-paste the sys_id of the above new theme apply it as a user preference: similar steps to above, but set the sys_ux_style type to 'variant' (use insert and stay) then add it to the same theme as the core one. Log out and back in and go to user preferences> themes other options see the ux style 'colors' for list of options/ideas (https://<YOUR_INSTANCE>.service-now.com/nav...

ServiceNow Next UI: theme your instance

references: https://docs.servicenow.com/en-US/bundle/tokyo-platform-user-interface/page/administer/navigation-and-ui/task/configure-next-experience-theme.html you can go for the 'variant' approach which then enables you to select it as a user preference, or 'core' to override the out of the box https://www.servicenow.com/community/next-experience-articles/create-your-first-next-experience-ui-theme/ta-p/2331961 https://www.servicenow.com/community/next-experience-articles/theme-your-next-experience-enabled-production-and-sub-production/ta-p/2331960 https://theme.deoprototypes.com/color-generator-p/ https://docs.servicenow.com/bundle/tokyo-platform-user-interface/page/administer/navigation-and-ui/task/override-next-experience-theme.html (ServiceNow )

ServiceNow turn Next UI Experience on/off

to allow an individual user to set it:  create a property called ' glide.ui.polaris.on_off_user_pref_enabled' it can then be toggled on/off see  https://www.youtube.com/watch?v=2LvchcCTne0 and https://www.servicenow.com/community/now-platform-articles/allow-users-to-switch-between-next-experience-ui-and-ui16/ta-p/2316994 to switch it on/off across the board: set sys property glide.ui.polaris.experience to true (next ui enabled) or false (disabled) see  https://www.servicenow.com/community/developer-articles/enable-disable-next-experience-ui-on-user-level-san-diego/ta-p/2318513 (ServiceNow )

ServiceNow Another way to locate application verison - my company applications

  (ServiceNow )

ServiceNow Another way to locate application verison - sys_scope table

  (ServiceNow )

ServiceNow Script actions

 You can use script actions to create server-side scripts that perform a variety of tasks, such as modifying a configuration item (CI), or managing failed login attempts. Script actions are triggered by events only. link:  https://docs.servicenow.com/bundle/tokyo-platform-administration/page/administer/platform-events/reference/r_ScriptActions.html (ServiceNow )  

ServiceNow Scripted Extension Points

 see link: https://docs.servicenow.com/bundle/tokyo-application-development/page/build/applications/concept/extension-points.html and https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/no-namespace/GlideScriptedExtPtScopedAPI search script includes with script contains  GlideScriptedExtensionPoint My own test example: 1) script include create a new script include include (in below example, I have called this  rds_test_extens_point ), and add code similar to below: var rds_test_extens_point = Class.create(); rds_test_extens_point.prototype = { initialize: function() { }, process:function(param1,param2){    gs.print('hello');    var result = [];        try{          var epoints = new global.GlideScriptedExtensionPoint();           var eps = epoints.getExtensions("rdsTestExtPt");           //gs.print('eps.length::' + eps.length);     ...