Skip to content

Instantly share code, notes, and snippets.

View nancystodd's full-sized avatar

Nancy S Todd nancystodd

View GitHub Profile
@nancystodd
nancystodd / gist:e32d19fac97a9931f6cd6628c0d27210
Created August 19, 2024 18:48 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nancystodd
nancystodd / 01.bash_shortcuts_v2.md
Created August 19, 2024 18:39 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line

ServiceNow - Jelly scripting cheatsheet

UI Page consists of jelly, client script and processing script. UI Macro has the jelly script only (but client script can be injected in jelly script) Usages:

  • Open as a page using URI https://<instance_name>.service-now/<ui_page_name>.do
  • Open as a modal using client script (UI action, client script, etc) (see snippet 1)
// Snippet 1
var gm = new GlideModal('UI_dialog_name');
gm.setTitle('Show title');
@nancystodd
nancystodd / sn-glide-field.txt
Last active February 5, 2023 21:17
Make ServiceNow Glide Object Visible
var fieldTypes = new GlideRecord('sys_glide_object');
fieldTypes.addQuery('sys_id', 'IN', ['sys_id_1', 'sys_id_2']);
fieldTypes.setValue('visible', true);
fieldTypes.updateMultiple();
function (someString) {
// test string is opened with curly brace or machine bracket
if (someString.trim().search(/^(\[|\{){1}/) > -1) {
try { // it is, so now let's see if its valid JSON
var myJson = JSON.parse(someString);
// yep, we're working with valid JSON
} catch (e) {
// nope, we got what we thought was JSON, it isn't; let's handle it.
}
} else {
@nancystodd
nancystodd / gist:f61041a4355276ef8798095d2fca2202
Created April 25, 2020 16:09
ServiceNow --None-- values for choice lists
The -- None -- option may not have a sys_choice record associated with it.
A choice list field set to -- None -- evaluates to these values, depending on the script context as listed below.
For client-side scripts,such as client scripts: "" (empty string)
For server-side scripts, such as business rules: "0" (string of the number zero)
@nancystodd
nancystodd / gr_props_values
Last active April 24, 2020 19:04
Glide Record Print all Properties and Values Example
// This is just a handy snippet I use when troubleshooting glide records
// in a background script to quickly see all the properties and values of a glide record
// Just change the table name and query for the glide record to test
var gr = new GlideRecord("<your_table_name>");
gr.addQuery("<field_name>", "<value>");
gr.query();
while (gr.next()) {
for (var prop in gr ){

GlideRecord & GlideAggregate Cheat Sheet ❗

GlideRecord(String tableName) ❗

var gr = new GlideRecord('incident'); // use the incident table
gr.query(); // fetch data from the database
while (gr.next()) { // advance
    gs.info(gr.short_description);
}
@nancystodd
nancystodd / JSUtil2.js
Created December 20, 2019 18:21 — forked from abhididdigi/JSUtil2.js
This is the entire JSUtil2 script. Creating a gist, to show it on Service Now diary.com
/*
* JSUtil already has some utility functions, Some more utility functions.
* Written by [email protected]
* Re-written for Service Now from underscore.js: http://underscorejs.org/
*
*/
var JSUtil2 = Class.create();

ServiceNow UI Developer cheat sheet


Utility URLs

URL Purpose
/stats.do Quick stats
/threads.do View active threads