Mixed Bag of Tips, Tricks & Resources - Part 2

In part 1, I shared a collection of random, but useful and probably good-to-know-someday information about ServiceNow collected from the various developers who share knowledge with the ServiceNow community.

Part 2 highlights some tidbits that I picked up from Kalaiarasan Pushpanathan’s Today I Learned (TIL) series. I especially liked these because they were often very specific and code based, rather than general advice. 

  1. If you create a template (sys_template) with the same name as the table, the template gets applied automatically to all new records created for that table. Is this perhaps another way of setting default values? https://www.linkedin.com/posts/iamkalai_servicenow-activity-6628561093490954241-0doc

  2. In case you did not know, Gliderecord's update() has an optional parameter which you can use to pass the reason for the update. The reason gets displayed (field-Reason) in Audit record (sys_audit).
    Ex: <glide object>.update('Test Update'); https://www.linkedin.com/posts/iamkalai_servicenow-activity-6628141644069781504-XWrJ

  3. If you want to know the connection speed between your computer and your instance, you can do so by visiting the URL: yourinstance/connection_test.do
    https://www.linkedin.com/posts/iamkalai_til-servicenow-activity-6668864912032460800-Biho

  4. You may know that get() function can accept two arguments. When you pass two arguments, the first becomes the column for searching and the second is the value. But you should also know that get() can return multiple records based on the condition passed. So do not write your script under the assumption that get() will return only one record.
    https://www.linkedin.com/posts/iamkalai_til-servicenow-activity-6667122686709260288-15IQ

  5. For completed update set on the production instance, you should always change the state to Ignore. This state ensures that the update set is not committed again when cloning the instance. https://www.linkedin.com/posts/iamkalai_til-servicenow-activity-6633172413498564608-7VoP

Kalaiarasan started posting these snippets of code and tidbits of information on LinkedIn, often with the tag #TIL. Now, the tips are on GitHub which means you can watch the repo - subscribe to it to receive the tips via email. No need to proactively check for information. Just wait for it to roll in to your inbox. https://github.com/iamkalai/SNTIL 

Previous
Previous

URL Parameter to Sort a Grouped List by Count

Next
Next

Mixed Bag of Tips, Tricks & Resources - Part 1