Table of Contents
Welcome to our SNOW INFO PAGE Section G
getReference()
This is the magical client-side function which takes one parameter (a client-side reference field), and returns all the data about that field via ajax and lets you use the data on the client side via a callback function (second parameter). I love this function. The table involved is implied, and derived from the definition of the reference field itself.
Example call: g_form.getReference('u_direct_supervisor', setManagerPlusOneField); Example callback function: function setManagerPlusOneField(magicalRecordFromServer)
{
//If we were successful in getting data back from the server, that is, if this object is non-null... if (magicalRecordFromServer) { g_form.addInfoMessage('magicalRecordFromServer:' + magicalRecordFromServer); //Populated object. g_form.addInfoMessage('magicalRecordFromServer.name:' + magicalRecordFromServer.name); g_form.addInfoMessage('magicalRecordFromServer.sys_id:' + magicalRecordFromServer.sys_id); g_form.addInfoMessage('magicalRecordFromServer.manager:' + magicalRecordFromServer.manager); //Finally, set the actual value we care about. Our work here is done. g_form.setValue('u_1_supervisor', magicalRecordFromServer.manager); }
}
See c_getReference syntax editor macro.
https://www.servicenow.com/community/developer-forum/getreference-best-practice-or-not/m-p/1522500/page/3 https://servicenowguru.com/scripting/client-scripts-scripting/gform-getreference-callback/
GlideReocrd
getDisplayValue() Retrieves the display value for the current record. Display values are manipulated based on the actual value in the database and user or system settings and preferences. The display value that is returned is dependent on the field type. Choice fields: The database value may be a number, but the display value will be more descriptive. Date fields: The database value is in UTC format, while the display value is based on the user's time zone. Encrypted text: The database value is encrypted, while the displayed value is unencrypted based on the user's encryption context. Reference fields: The database value is sys_id, but the display value is a display field of the referenced record.
GlideModal()
- Can be used to show a popup window? May be very useful for debugging.
Global Search
- Tables
ts_index_name
sysevent_list - Global Search Properties
- System Properties - Global Text Search
Zing indexes punctuation as part of some words
https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/search-administration/task/set-global-text-search-properties.html
https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/search-administration/task/t_AddASearchGroup.html https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/search-administration/concept/c_ZingTextSearch.html https://support.servicenow.com/kb?id=kb_article_view&sys_kb_id=d1e71538dbc430d016d2a345ca961945 https://docs.servicenow.com/bundle/sandiego-platform-administration/page/administer/search-administration/task/t_ConfigureAnAutomaticStopWord.html - System Definition - Text Index Stop Words
- Believe these are Stop Words which apply to All Tables.
- System Definition - Text Indexes (table ts_index_name) - Task Table (index_name view) Index Stop Words: https://[YourInstanceName].service-now.com/nav_to.do?uri=%2Fts_index_name.do%3Fsys_id%3D8ad30ae34123b40021611cbb20d71eb0%26sysparm_view%3Dindex_name - When a table is indexed, if the count for a particular word reaches a certain threshold such as 100,000, that word is automatically added to the Stop Word list and will no longer be searchable.
- Text Indexes / System Definition - Text Indexes - By default, the system maintains text indexes on a daily schedule. Typically you only need to manually regenerate a text index when you change “stop words” or “display values”. - Text indexing can be a resource-intensive task that may take a while to complete. You may notice performance degradation or incomplete search results during index generation.
- Tables
ts_index_name sys_number_counter
- Should be able to check on progress of text events here:
https://[YourInstanceName].service-now.com/sysevent_list.do?sysparm_query=sys_created_onONToday%40javascript%3Ags.beginningOfToday()%40javascript%3Ags.endOfToday()%5EnameSTARTSWITHtext_index%5Estate!%3Dprocessed%5EORstate%3DNULL&sysparm_view=
- Add the “state” column to your list view.
- May be used to see which tables are currently in a state of “Indexing”, rather than “Ready”.
- Text indexes are built against the highest level parent table. ??? - To Generate a Text Index for a custom table for the very first time, from the sys_dictionary page, click on the related link “Generate Text Index”.
- If you do not see a “Generate Text Index” link, check two things:
1. Is at least one column in the table set to Text index = true?
2. Does the table appear in a Text Search Group (ts_group).
- Quirks - Apparently the underscore _ character counts as “punctuation” and punctuation does not participate in Exact Phrase Searches, so there is no way to search for “aaaaa_bbbbb” and have it only return records containing that compound term. ServiceNow will instead find all records containing “aaaaa” and “bbbbb”. :( - If a table refuses to index, that is, it refuses to appear in table “ts_index_name”, check the following:
- Look in the Number Counters table (sys_number_counter) for the table “Text Index” and make a note of the value in the Number field.
Example Query: https://[YourInstanceHere].service-now.com/nav_to.do?uri=%2Fsys_number_counter_list.do%3Fsysparm_query%3Dtable.labelLIKEindex%26sysparm_first_row%3D1%26sysparm_view%3D%26sysparm_choice_query_raw%3D%26sysparm_list_header_search%3Dtrue - Look in the Text Indexes table (ts_index_name) and make a note of the largest value in the Number column. This value should be No Larger than the value in the other table (sys_number_counter).
Example Query: https://[YourInstanceHere].service-now.com/nav_to.do?uri=%2Fts_index_name_list.do
Governance, Risk, and Compliance - (GRC)
Group, Role, & User Tables - Groups - Roles - Users
- Any ITIL user can see these tables. sys_user (Users) sys_user_role (Roles) (Confusing table name) sys_user_has_role (User Roles) (Roles assigned to individual users) sys_user_group (Groups) (Confusing table name) sys_group_has_role (Group Roles) (Roles assigned to each Group) sys_user_grmember (Group Member) (Users assigned to each Group) - Believe the Group Membership Histories table can be used to see when a user was added or removed from a group.
Group/Role/User - Deployment Steps
1. Set your application to Global, and then open an Update Set Manually. 2. Delete any unwanted, existing Group / Role / User records. 3. Add any new Group / Role / User records. 4. Filter the top level tables to the items you want, check those items, and use the “Add to Update Set” UI Action. Do this for: Users and Groups and Roles. When you do this, the M2M tables “Group Roles” and “Group Member” will AUTOMATICALLY be added to the new, Global, update set. The remaining M2M table, “User Roles”(sys_user_has_role) will NOT automatically be added, however (not sure why). 5. Use the “Add to Update Set” UI Action on the remaining M2M table “User Roles (sys_user_has_role).
Table Table Name How to Capture Notes Users sys_user Use “Add to Update Set” Top Level Table Groups sys_user_group Use “Add to Update Set” Confusing table name. Roles sys_user_role Captured Automatically Role Changes automatically go into Update Sets (on the FCC Instance) Group Roles sys_group_has_role Captured Indirectly The Roles assigned to each Group. Group Member sys_user_grmember Captured Indirectly The Users assigned to each Group. User Roles sys_user_has_role “Add to Update Set”!! The Roles assigned to individual users.
6. On the Target system, if you think there may be records which were added there directly, and you want those REMOVED, so that the target will be exactly the same as the source, you will need to carefully MANUALLY DELETE those records. (An Update Set deployment is obviously different from a Clone in this way.) 7. For any records which were Deleted from the target after the initial Deployment… Upon a 2nd Deployment, they will show up as “Found a local update that is newer than this one”. (This is confusing verbiage. It would be nice if it said “Deleted Record Detected” instead. If you do a “Compare with Local” operation, you will see “Local Update - Action - Delete” and “Remote Update - Insert_or_Update”. Show Local Record will show a Related List of “Deleted Data”. Show Local Update will show 'action=“DELETE”' in the Payload XML. The appropriate action, in this case, if you want the Target to be the same as the Source, is to “Accept Remote Update”.
Records from the following tables added: User: User, Bookmark, Group Member, Live Profile, User, User Role Group: Group, Group Member, Group Role Roles: Roles User Roles: User Role
Group Types
- Tables
sys_user_group
- Groups of users in ServiceNow may be used for all of the following purposes. - Groups may also be setup in hierarchies, so a Group may be the child of another Group. - Best Practice Group Types
- Assignment
- Designates a Group with responsibility for working on a task, or assigning the task to another group.
- Examples
Application Developers
Database Administrators Human Resources Benefits Payroll Recruiting Network Administrators Server Administrators Service Desk
- Questions to ask when someone says they want a New assignment group… - Why do you need it? - What will you relate it to from a Configuration Item perspective?
- Do we need to make any adjustments to existing workflow?
- Approval
- Responsible for Approving a ticket so it may move forward in a workflow.
- Examples
Change Advisory Board (CAB) - Security
- Simply a collection of roles which specify what a user may do in the system.
- Not intended to be used for ticket Approvals or Assignment of tickets.
- Users assigned to the security group acquire all of the roles from the group.
- Examples
ITIL
ITIL Admin Knowledge Knowledge Admin
- Email Notification Group
- Used to collectively email a number of users.
- It is typical to setup a Catalog Item which users may use to request to be added to or removed from a group. This ticket is usually routed to the Manager of the designated Group, and perhaps to the user's direct manager as well. Once approved, the user is automatically added to or removed from the group without ServiceNow Admin involvement.
Guided App Creator – GAC
- Takeaway - Guided App Creator is a step-by-step wizard which allows the user to create a brand new application form the ground up. You may define a table, upload images, and layout the UI. You may also define the Roles which will have access to the application. - Modules System Applications > My Company Applications - Allows you to create a brand new Scoped Application, including the following components: - Name - Image - Table - Roles - Layout (Form or List?) - Automatically adds these fields to any table you define: - Number - Human readable number such as INC2619653. Optional. - Created - When the record was initially created. - Created By - Who initially created the record. - Updated - When the record was last modified. - Updated By - Who last modified the record. - Updates - How many updates there have been to the record. - Sys ID - The unique identifier for the record, used behind the scenes. - After you create a new application using the Guided App Creator, you may need to refresh the browser in order for it to show up in the Application Navigator. - Does not support Microsoft Edge or Internet Explorer 11. - By default, GAC does not provide a way to create a Global Application. To do this, create a system property “sn_g_app_creator.allow_global” and set it to true.
GGB Logging Conventions
gs.log(“START Workflow Activity 'Create Server CI'”, “Phoenix”); gs.log(“workflow.scratchpad.configItemID: ” + workflow.scratchpad.configItemID, “Phoenix”); gs.log(“Start Loop.”, “Phoenix”); gs.log(“End Loop.”, “Phoenix”); gs.log(“END Workflow Activity 'Create Server CI'”, “Phoenix”);