<h2>Field watcher</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="concept" /><meta name="DC.title" content="Field watcher" /><meta name="abstract" content="The field watcher tool tracks and displays all actions that the system performs on a selected form field." /><meta name="description" content="The field watcher tool tracks and displays all actions that the system performs on a selected form field." /><meta name="DC.subject" content="Field Watcher" /><meta name="keywords" content="Field Watcher" /><meta name="DC.relation" scheme="URI" content="../../../script/debugging/concept/script-debug-overview.html" /><meta name="DC.relation" scheme="URI" content="../../../build/applications/concept/api-implementation-reference.html" /><meta name="DC.relation" scheme="URI" content="../../../build/applications/concept/api-implementation.html" /><meta name="DC.relation" scheme="URI" content="../../../script/topic/c_Script.html" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2025-07-31" /><meta name="page-type" content="platform" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="c_FieldWatcher" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Field watcher</title></head><body> <div class="nested0" id="c_FieldWatcher"> <h1 class="title topictitle1" id="ariaid-title1">Field watcher</h1> <div class="body conbody"><p class="shortdesc">The field watcher tool tracks and displays all actions that the system performs on a selected form field.</p> <div class="note"><span class="notetitle">Note:</span> Field watcher is not supported with <span class="ph">Next Experience</span> in <span class="ph">Utah</span>. For more information about supported features in <span class="ph">Next Experience</span>, see <a class="xref" href="https://docs.servicenow.com/csh?topicname=next-experience-adoption-paths&version=zurich&pubname=zurich-platform-user-interface" target="_blank" rel="noopener noreferrer">Considerations for activating Next Experience</a>.</div> <p class="p">Administrators can use the field watcher to figure out what happens to the field and how the value of the field changes when an event such as the firing of a business rule or enforcement of a data policy, takes place. Administrators can also impersonate non-admin users to debug what happens when those users make changes on an instance. Only one field can be watched at a time. Non-admin users with the impersonator role have access to the field watcher feature.</p> <div class="section"><h2 class="title sectiontitle">How the field watcher works</h2> <div class="p">The Field Watcher tool logs activity when any of the following events occur on a field:<ul class="ul" id="c_FieldWatcher__ul_hl5_nqd_qp"><li class="li">The default value is set on the field.</li><li class="li">User access rights for the field change due to an ACL or dictionary setting.</li><li class="li">A data policy prevents the value from being set.</li><li class="li">A reference qualifier query of the field value executes.</li><li class="li">A UI policy changes a field to or from read-only, visible, mandatory, or editable.</li><li class="li">A dependent value in another field restricts field choices.</li><li class="li">The value of the field is set or changed based on:<ul class="ul" id="c_FieldWatcher__ul_jbl_wqd_qp"><li class="li">Assignment rules</li><li class="li">Actions from an engine, such as the workflow engine</li><li class="li">Business rules</li><li class="li">User entries</li><li class="li">Client scripts</li><li class="li">UI actions</li></ul> </li></ul> <div class="note"><span class="notetitle">Note:</span> The field watcher works only on form fields. It cannot be used on list fields. Also, field watcher is not available on password-protected fields or encrypted fields. Field watcher is only available within the UI frame. The option to watch a field does not appear in the context menu if you open a record outside of the UI frame, for example, in a new tab.</div> </div> </div> </div> <div class="related-links"> <div class="familylinks"> <div class="parentlink"><strong>Parent Topic:</strong> <a class="link" href="https://servicenow.com/docs/bundle/zurich-api-reference/page/script/debugging/concept/script-debug-overview.html" title="Debug scripts using session logs and ServiceNow AI Platform debugging tools such as a walk-through script debugger and error messages that display in the UI.">Debugging scripts</a></div> </div> </div><div class="topic task nested1" id="t_UsingFieldWatcher"> <h2 class="title topictitle2" id="ariaid-title2">Use field watcher</h2> <div class="body taskbody"><p class="shortdesc">Access field-level debugging information using the field watcher.</p> <div class="section prereq p" id="t_UsingFieldWatcher__prereq_lhc_wf4_45b"> <p class="p">Role required: none</p> </div> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd">Navigate to the form for which you want to view field-level debugging information.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Activate field watcher by right-clicking any field label on a form and select <span class="ph uicontrol">Watch - '<field name>'</span>.</span> <div class="itemgroup info"> <p class="p">The debug icon (<img class="image icon" id="t_UsingFieldWatcher__image_alv_b5d_qp" src="../image/Debug.png" alt="The debug icon" />) appears next to the field label. From this point on, the field watcher records every action taken on the selected field. For example, if you are watching a <span class="keyword option">Priority</span> field, if the priority is changed from Moderate to Low and the record is updated, the field watcher will display information about that change.</p> </div> </li><li class="li step stepexpand"> <span class="ph cmd">View the field watcher log by clicking the debug icon.</span> <div class="itemgroup info">A new pane opens at the bottom of the screen, showing a field watcher tab. It may also show tabs for <a class="xref" href="https://servicenow.com/docs/bundle/zurich-api-reference/page/script/debugging/concept/c_WritingToTheDebugLog.html" title="To write to the debug log in your client-side JavaScript, or UI policies, make a call to the global function jslog().">JavaScript Logging</a> and JavaScript Debugger.</div> </li><li class="li step stepexpand"> <span class="ph cmd">Click the <span class="ph uicontrol">Field Watcher</span> tab, if needed.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Stop watching a field by right-clicking the field and selecting <span class="ph uicontrol">Unwatch - <field name></span>.</span> <div class="itemgroup info">To watch another field, right-click that field and select <span class="ph uicontrol">Watch - <field name></span>.</div> </li><li class="li step stepexpand"> <span class="ph cmd">Clear the field watcher log by clicking the clear log button (<img class="image icon" id="t_UsingFieldWatcher__image_tzb_xtd_qp" src="../image/FieldWatcherClearLogButton.png" alt="The clear log button" />).</span> </li><li class="li step stepexpand"> <span class="ph cmd">Resize the field watcher pane by dragging the splitter bar up or down.</span> <div class="itemgroup info">Dragging the splitter bar to the bottom of the screen closes the field watcher pane. Reopen the pane by clicking the debug icon again.</div> </li></ol> </div> <div class="topic concept nested2" id="c_SettingUpTheFieldWatcherTab"> <h3 class="title topictitle3" id="ariaid-title3">Field watcher tab details</h3> <div class="body conbody"><p class="shortdesc">The field watcher displays field information and configuration options.</p> <div class="p">The left-side of the Field Watcher tab shows the following information for the watched field.<ul class="ul" id="c_SettingUpTheFieldWatcherTab__ul_s14_t5d_qp"><li class="li"><span class="ph uicontrol">Table</span>: table to which the field belongs.</li><li class="li"><span class="ph uicontrol">Element</span>: field label.</li><li class="li"><span class="ph uicontrol">Type</span>: type of data stored in the field.</li><li class="li"><span class="ph uicontrol">Dependent</span>: field on which the current field depends.</li><li class="li"><span class="ph uicontrol">Reference</span>: table from which the field's value originates, if applicable.</li><li class="li"><span class="ph uicontrol">Reference Qual</span>: reference qualifiers that may be restricting data on the field.</li><li class="li"><span class="ph uicontrol">Attributes</span>: attributes on the field as specified in the dictionary entry for that field.</li></ul> </div> <p class="p">On the right-side of the Field Watcher tab, select the types of activity information you want to see for the selected field. Clear the check box for any type of information that is not needed.</p> </div> </div> <div class="topic task nested2" id="t_WatchingAHiddenField"> <h3 class="title topictitle3" id="ariaid-title4">Watching a hidden field</h3> <div class="body taskbody"><p class="shortdesc">Administrators may need to watch a hidden field.</p> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd">Use the dictionary to determine the column name of the field.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Elevate privileges to the security_admin role.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Navigate to <span class="ph menucascade"><span class="ph uicontrol">System Definition</span> > <span class="ph uicontrol">Scripts Background</span></span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">In <span class="keyword option">Run script (JavaScript executed on server)</span>, enter the following command:</span> <div class="itemgroup info"> <pre class="pre codeblock"><code>gs.getSession ( ). setWatchField ( "hidden_field" ) ;</code></pre> <p class="p">Replace hidden_field with the column name of the hidden field.</p> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Navigate to the form containing the missing field.</span> <div class="itemgroup info"> <p class="p">The Field Watcher tab output contains information about the hidden field.</p> </div> </li></ol> </div> </div> </div> <div class="topic concept nested1" id="c_ViewInfoWatchedField"> <h2 class="title topictitle2" id="ariaid-title5">Viewing information for the watched field</h2> <div class="body conbody"><p class="shortdesc">When information for a watched field is changed and the record is updated, the field watcher tab displays relevant information at the bottom.</p> <div class="p"><div class="fig fignone" id="c_ViewInfoWatchedField__fig_o1m_2wd_qp"><span class="figcap"><span class="fig--title-label">Figure 1. </span>Field watcher viewing data</span> <img class="image" id="c_ViewInfoWatchedField__image_vph_gwd_qp" src="../image/FieldWatcherViewingData.png" alt="Field watcher viewing data" /> </div> </div> <div class="p">Field watcher information includes:<ul class="ul" id="c_ViewInfoWatchedField__ul_c2n_jwd_qp"><li class="li"><span class="ph uicontrol">Timestamp</span>: time the field was changed using the HH:MM:SS (ms) format.<ul class="ul" id="c_ViewInfoWatchedField__ul_thf_nwd_qp"><li class="li"><span class="ph uicontrol">Orange text</span>: server-side changes, such as ACLs.</li><li class="li"><span class="ph uicontrol">Blue text</span>: client-side changes, such as client scripts.</li></ul> </li><li class="li"><span class="ph uicontrol">Type of object that changed the field and its associated name</span>: The type of item that changed on the field; for example, <span class="ph uicontrol">CLIENT SCRIPT</span>, <span class="ph uicontrol">BUSINESS RULE</span>, or <span class="ph uicontrol">ACL</span>. In the case of scripts, business rules, or other configuration-type fields, field watcher displays the name of the script or business rule that changed the field, if any. Click the name to go directly to the record for that item.</li><li class="li"><span class="ph uicontrol">Old and new values</span>: The old and new values for the field, if the value changed0. Field watcher does not record the value if it was inserted in the form by default at the time the record was created.</li><li class="li"><span class="ph uicontrol">Additional information</span>: Call tracing information, such as the name of the script engine or workflow that changed the field. Click the plus icon to expand the selection.<ul class="ul" id="c_ViewInfoWatchedField__ul_yh5_swd_qp"><li class="li"><span class="ph uicontrol">Orange text</span>: Indicates server-side activity.</li><li class="li"><span class="ph uicontrol">Blue text</span>: Indicates client-side activity.</li></ul> </li></ul> </div> </div> </div> <div class="topic concept nested1" id="c_ExWatchingTheIncidentPriority"> <h2 class="title topictitle2" id="ariaid-title6">Example: Watching the incident priority</h2> <div class="body conbody"><p class="shortdesc">The following example shows what happens to the <span class="ph uicontrol">Priority</span> field on the incident form when both the <span class="ph uicontrol">Impact</span> and <span class="ph uicontrol">Urgency</span> fields change.</p> <div class="p">The Incident form has two client-side data lookups change the priority. Additionally, server-side ACLs and the data lookup engine fire when the record is saved. Finally, a client-side UI policy sets the <span class="ph uicontrol">Priority</span> field back to read-only, which is the default setting. <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="c_ExWatchingTheIncidentPriority__table_psz_5n2_qp" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 1. </span>Watching the incident priority</span></caption><colgroup><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1384272e674">Original values</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1384272e674 "><ul class="ul" id="c_ExWatchingTheIncidentPriority__ul_ezq_wn2_qp"><li class="li">Priority:1 - Critical</li><li class="li">Impact:1 - High</li><li class="li">Urgency:1 - High</li></ul> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1384272e674 ">First Change</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1384272e674 "><ol class="ol" id="c_ExWatchingTheIncidentPriority__ol_qhc_zn2_qp"><li class="li">The user changes the <span class="ph uicontrol">Impact</span> value to <span class="ph uicontrol">3 - Low</span>.</li><li class="li">The priority automatically changes to <span class="ph uicontrol">3 - Moderate</span> based on the <span class="ph uicontrol">Priority Lookup</span> data lookup definition used by default in <span class="ph">ServiceNow</span> incidents.</li></ol> <div class="note"><span class="notetitle">Note:</span> At this point, the record has not been saved.</div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1384272e674 ">Second Change</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1384272e674 "><ol class="ol" id="c_ExWatchingTheIncidentPriority__ol_lbm_242_qp"><li class="li">The user changes the <span class="ph uicontrol">Urgency</span> value to <span class="ph uicontrol">2 - Medium</span>.</li><li class="li">The priority automatically changes to <span class="ph uicontrol">4 - Low</span> based on the same <span class="ph uicontrol">Priority Lookup</span> data lookup definition.</li><li class="li">The user saves the record by right-clicking the form header and choosing <span class="ph uicontrol">Save</span>.</li></ol> </td></tr></tbody></table> </div> <div class="fig fignone" id="c_ExWatchingTheIncidentPriority__fig_b32_k42_qp"><span class="figcap"><span class="fig--title-label">Figure 2. </span>Field watcher example</span> <img class="image" id="c_ExWatchingTheIncidentPriority__image_cyz_l42_qp" src="../image/FieldWatcherExample1.png" alt="" /> </div> <div class="note"><span class="notetitle">Note:</span> The values that change from 1 to 3, and then from 3 to 4, refer to the numerical values in the choice list.</div> </div> </div> </div> </div> </body></html></div>