<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Debendu Das on Medium]]></title>
        <description><![CDATA[Stories by Debendu Das on Medium]]></description>
        <link>https://medium.com/@debendudas?source=rss-9c27be73a80f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*45EGmxOUgiL7Kz9Sm7lDzg.jpeg</url>
            <title>Stories by Debendu Das on Medium</title>
            <link>https://medium.com/@debendudas?source=rss-9c27be73a80f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:55:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@debendudas/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[getXML() vs. getXMLWait() in ServiceNow: Choosing the Right GlideAjax Method]]></title>
            <link>https://debendudas.medium.com/getxml-vs-getxmlwait-in-servicenow-choosing-the-right-glideajax-method-79cc27841631?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/79cc27841631</guid>
            <category><![CDATA[glidexml-vs-glidexmlwait]]></category>
            <category><![CDATA[servicenow-communities]]></category>
            <category><![CDATA[glideajax]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 07:21:55 GMT</pubDate>
            <atom:updated>2025-09-18T07:21:55.842Z</atom:updated>
            <content:encoded><![CDATA[<p>When building dynamic client-side functionality in ServiceNow, GlideAjax is a powerful tool to interact with server-side Script Includes. But developers often face a choice between two core methods: getXML() and getXMLWait().</p><p>Understanding the difference between these two can help you write more efficient, user-friendly scripts. Let’s dive into how they work, when to use them, and the trade-offs involved.</p><h3>🔄 1. getXML() – Asynchronous GlideAjax Call</h3><h4>🔧 How It Works:</h4><p>getXML() sends a request to the server and <strong>does not wait</strong> for the response. Instead, it continues executing the rest of the script. Once the server responds, a <strong>callback function</strong> is triggered to handle the result.</p><h4>✅ Pros:</h4><ul><li>Keeps the <strong>UI responsive</strong>.</li><li>Allows users to continue interacting with the form while the server processes the request.</li></ul><h4>⚠️ Cons:</h4><ul><li>The response arrives <strong>after</strong> the rest of the script has executed.</li><li>If the user acts quickly (e.g., clicks “Save” immediately), the response might come <strong>too late</strong> to influence the outcome.</li></ul><h4>🧪 Example:</h4><pre>var ga = new GlideAjax(&#39;MyScriptInclude&#39;);<br>ga.addParam(&#39;sysparm_name&#39;, &#39;getAssignmentGroup&#39;);<br>ga.getXML(function(response) {<br>    var answer = response.responseXML.documentElement.getAttribute(&quot;answer&quot;);<br>    alert(&quot;Assignment Group: &quot; + answer);<br>});</pre><h3>⏳ 2. getXMLWait() – Synchronous GlideAjax Call</h3><h4>🔧 How It Works:</h4><p>getXMLWait() sends a request and <strong>waits</strong> for the server to respond before continuing. This means the script execution is <strong>paused</strong> until the response is received.</p><h4>✅ Pros:</h4><ul><li>Guarantees that the server response is available <strong>immediately</strong> after the call.</li><li>Useful when you need to <strong>block form submission</strong> or take immediate action based on server data.</li></ul><h4>⚠️ Cons:</h4><ul><li><strong>Freezes the UI</strong>, leading to poor user experience.</li><li>Not recommended for production use, especially on slow networks.</li><li>ServiceNow <strong>discourages</strong> its use in client-side scripts.</li></ul><h4>❌ <em>getXMLWait() </em>Not Supported in Service Portal:</h4><blockquote>One important limitation is that getXMLWait() <strong>does not work in Service Portal</strong>. This is because Service Portal uses AngularJS which has asynchronous architecture that <strong>does not support synchronous XMLHttpRequests</strong>, which getXMLWait() relies on.</blockquote><blockquote>🛑 Using getXMLWait() in Service Portal will result in <strong>no response</strong> or <strong>script errors</strong>, breaking your functionality.</blockquote><blockquote><strong>ServiceNow support article: </strong><a href="https://noderegister.service-now.com/kb?id=kb_article_view&amp;sysparm_article=KB0679499"><strong>Link</strong></a></blockquote><h4>🧪 Example:</h4><pre>var ga = new GlideAjax(&#39;MyScriptInclude&#39;);<br>ga.addParam(&#39;sysparm_name&#39;, &#39;getAssignmentGroup&#39;);<br>var response = ga.getXMLWait();<br>var answer = response.responseXML.documentElement.getAttribute(&quot;answer&quot;);<br>alert(&quot;Assignment Group: &quot; + answer);</pre><h3>📌 Real-World Scenario Comparison</h3><p>Let’s say you want to alert the user when they change the assignment group on a form:</p><ul><li>With <strong>getXML()</strong>, the alert will appear <strong>after</strong> the change, possibly too late if the user quickly clicks &quot;Save&quot;.</li><li>With <strong>getXMLWait()</strong>, the alert appears <strong>immediately</strong>, but the UI freezes while waiting for the server; which is not ideal.</li><li>In <strong>Service Portal</strong>, only getXML() is usable — getXMLWait() will fail.</li></ul><h3>🧩 Bonus: Helper Methods: getXMLAnswer() and getAnswer()</h3><p>While getXML() and getXMLWait() are the <strong>core mechanisms</strong> for GlideAjax communication, ServiceNow provides helper methods to simplify response handling:</p><h4>🔹 getXMLAnswer()</h4><p>Used <strong>inside the callback function</strong> of getXML(), this method extracts the answer attribute directly from the XML response.</p><pre>ga.getXML(function(response) {<br>    var answer = response.getXMLAnswer(); // cleaner than manual XML parsing<br>    console.log(&quot;Server response: &quot; + answer);<br>});</pre><h4>🔹 getAnswer()</h4><p>Used with the response object returned by getXMLWait(), this method extracts the answer attribute without manual XML parsing.</p><pre>var response = ga.getXMLWait();<br>var answer = response.getAnswer(); // instead of parsing XML manually<br>console.log(&quot;Server response: &quot; + answer);</pre><blockquote><em>💡 These helper methods don’t change the behavior of </em><em>getXML() or </em><em>getXMLWait() — they simply make it easier to work with the response.</em></blockquote><h3>🏁 Final Thoughts</h3><p>To summarize:</p><ul><li>Use <strong>getXML()</strong> for asynchronous, non-blocking client-server communication.</li><li>Use <strong>getXMLWait()</strong> only when you absolutely need to block execution and <strong>never in Service Portal</strong>.</li><li>Use <strong>getXMLAnswer()</strong> and <strong>getAnswer()</strong> to simplify response handling and keep your code clean.</li></ul><p>Choosing the right method depends on your use case, but in most client-side scenarios, especially in Service Portal, <strong>asynchronous is the way to go</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79cc27841631" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GlideNavigation (g_navigation) in ServiceNow]]></title>
            <link>https://debendudas.medium.com/glidenavigation-g-navigation-in-servicenow-2afdb58dbac4?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2afdb58dbac4</guid>
            <category><![CDATA[servicenow-development]]></category>
            <category><![CDATA[servicenow-training]]></category>
            <category><![CDATA[gnavigation]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[glidenavigation]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 16:30:34 GMT</pubDate>
            <atom:updated>2025-07-01T16:30:34.337Z</atom:updated>
            <content:encoded><![CDATA[<p>Navigating through ServiceNow can sometimes feel like a maze, but what if I told you there’s a way to make it seamless and efficient? Enter GlideNavigation, a powerful API that gives you control over navigation and refreshing frames in your ServiceNow instance.</p><p>In this article, I’ll introduce you to the GlideNavigation API, explain its key methods, and share practical examples to help you use it effectively. Let’s make ServiceNow navigation a breeze! 🌟</p><h3>What is GlideNavigation?</h3><p>The GlideNavigation API is a collection of methods accessed via the global object</p><pre>g_navigation</pre><p>It allows you to:</p><ul><li>Redirect users to URLs or specific records.</li><li>Open popups for additional information.</li><li>Refresh the navigator or reload the current frame.</li></ul><h3>Key Methods and How to Use Them</h3><p>Let’s dive into the most useful methods GlideNavigation offers, along with real-world examples to show how they work.</p><h3>1. open(url, target)</h3><p>This method redirects users to a new URL. You can specify the frame where the content should load (e.g., the current frame or a specific one).</p><h4>Example: Open All Active Incidents of the Caller</h4><pre> var callerID = g_form.getValue(&quot;caller_id&quot;);<br> var url = &quot;incident_list.do?sysparm_query=active=true^caller_id=&quot; + callerID;<br> g_navigation.open(url, &quot;_blank&quot;);</pre><p>This code opens a list of all active incidents for a specific caller in the current frame. It’s perfect for quickly accessing incidents tied to a particular user without leaving your current workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LuCXEtJgB9r3dC1fA_QOTw.gif" /></figure><h3>2. openPopup(url, name, features, noStack)</h3><p>Need to open a URL in a popup window? This method lets you do just that, with options to customize the popup’s behavior (e.g., resizable, scrollbars, etc.).</p><h4>Example: Open Child Incidents in a Popup</h4><pre>var parentIncidentID = g_form.getUniqueValue();<br>g_navigation.openPopup(<br>    &#39;incident_list.do?sysparm_query=parent_incident=&#39; + parentIncidentID,<br>    &#39;Child Incidents&#39;,<br>    &#39;resizable,scrollbars,status&#39;,<br>    true<br>);</pre><p>This code opens a popup window to display all incidents that are children of a specific parent incident. It’s great for visualizing relationships between incidents without cluttering the main interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njw5UoWiLDaw3OZb64cLjA.gif" /></figure><h3>3. openRecord(tableName, sys_id)</h3><p>This method redirects users to a specific record in the navigator frame.</p><h4>Example: Open a Specific Incident Record</h4><pre>g_navigation.openRecord(&#39;incident&#39;, g_form.getValue(&quot;parent_incident&quot;));</pre><p>Here, we’re opening the parent incident record using its sys_id. This is super handy when you need to quickly access detailed information about a particular record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sz0K6sygB3fcXQkjOY1lVw.gif" /></figure><h3>4. refreshNavigator()</h3><p>Sometimes, the navigator needs a refresh to display the latest updates. This method does exactly that.</p><h4>Example: Refresh the Navigator</h4><pre>g_navigation.refreshNavigator();</pre><p>Use this method to ensure the navigator reflects the most up-to-date content without reloading the entire page.</p><h3>5. reloadWindow()</h3><p>Want to reload the current frame? This method makes it easy.</p><h4>Example: Reload the Current Frame</h4><pre>g_navigation.reloadWindow();</pre><p>This is useful when you’ve made changes and want to refresh the view to see them immediately.</p><h3>Why Should You Use GlideNavigation?</h3><p>Here’s why GlideNavigation is a must-have in your ServiceNow toolkit:</p><ul><li>Efficiency: Quickly navigate between lists, records, and views.</li><li>Flexibility: Open popups or target specific frames for a better user experience.</li><li>Simplicity: Refresh or reload content with minimal effort.</li></ul><h3>Final Thoughts</h3><p>The GlideNavigation API is a game-changer for anyone working in ServiceNow. By mastering its methods, you can create a smoother, more intuitive navigation experience for yourself and your users.</p><p>📌 Follow me for more ServiceNow tips and tricks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2afdb58dbac4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[sn-record-picker in ServiceNow]]></title>
            <link>https://debendudas.medium.com/sn-record-picker-in-servicenow-281f739933cd?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/281f739933cd</guid>
            <category><![CDATA[sn-record-picker]]></category>
            <category><![CDATA[portal]]></category>
            <category><![CDATA[widget]]></category>
            <category><![CDATA[servicenow]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Sun, 04 May 2025 06:30:06 GMT</pubDate>
            <atom:updated>2025-05-04T06:30:06.609Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of ServiceNow’s Service Portal development, few directives are as powerful and versatile as the sn-record-picker. Whether you’re building simple forms or advanced widgets, chances are you’ll need a user-friendly way for users to select records from ServiceNow tables. That’s exactly what sn-record-picker is built for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*Lwz7tMjUB-TTMH-t_S2tuA.png" /><figcaption>sn-record-picker in ServiceNow</figcaption></figure><p>In this guide, we’ll explore how to effectively use the sn-record-picker directive to create dynamic, interactive experiences in your Service Portal widgets.</p><h3>🔍 What Is sn-record-picker?</h3><p>At its core, sn-record-picker is an AngularJS directive that allows users to select a record (or multiple records) from a specified table in ServiceNow. It’s especially useful when you want to replicate the functionality of reference fields inside your custom widgets, but with more control over the behavior and appearance.</p><h3>🛠 Basic Usage</h3><p>Let’s start with a simple example: picking a user from the sys_user table.</p><h3>HTML:</h3><pre>&lt;sn-record-picker <br>    table=&quot;&#39;sys_user&#39;&quot; <br>    field=&quot;c.field&quot;&gt;<br>&lt;/sn-record-picker&gt;</pre><h3>Client Script:</h3><pre>c.field = {<br>    value: &#39;&#39;,<br>    displayValue: &#39;&#39;<br>};</pre><p>By default, this gives you a reference-style dropdown to select a user. But this is just scratching the surface.</p><h3>🧩 Key Attributes</h3><p>Here’s a rundown of the most commonly used attributes:</p><ul><li><strong>field</strong>: A JavaScript object that holds the selected record’s details. It typically contains displayValue, value, and name.</li><li><strong>table</strong>: The name of the table from which records should be fetched (e.g., &#39;sys_user&#39;).</li><li><strong>value-field</strong>: The field whose value is stored when a record is selected. Defaults to &#39;sys_id&#39;.</li><li><strong>display-field</strong>: The field shown in the UI for the selected record (e.g., &#39;name&#39;).</li><li><strong>search-fields</strong>: A comma-separated list of fields that will be used for searching (e.g., &#39;name,email&#39;).</li><li><strong>default-query</strong>: An encoded query string to filter which records appear (e.g., &#39;active=true&#39;).</li><li><strong>multiple</strong>: Set to true if you want to allow multiple record selection.</li><li><strong>display-fields</strong>: Additional fields to show in the dropdown (comma-separated).</li><li><strong>page-size:</strong> Number of records shown per page in the dropdown (default is 20).</li><li><strong>on-change</strong>: A function to execute when the selected value changes.</li><li><strong>options</strong>: An object that allows additional configuration, such as { cache: true, allowClear: true }.</li><li><strong>sn-disabled</strong>: Makes the picker read-only (disables selection).</li><li><strong>placeholder</strong>: Text displayed when no value is selected.</li><li><strong>startswith</strong>: If set to true, the search uses the STARTSWITH operator instead of CONTAINS.</li></ul><h3>🧠 Setting Default Values (Pre-population)</h3><p>To prefill the picker (e.g., with the current user), fetch the data on the server side and bind it in the client script.</p><h3>Server Script:</h3><pre>(function() {<br>    data.user = {<br>        name: gs.getUserDisplayName(),<br>        sys_id: gs.getUserID()<br>    };<br>})();</pre><h3>Client Script:</h3><pre>$scope.user = {<br>    displayValue: c.data.user.name || &#39;&#39;,<br>    value: c.data.user.sys_id || &#39;&#39;,<br>    name: &#39;user&#39;<br>};</pre><h3>HTML:</h3><pre>&lt;sn-record-picker <br>    field=&quot;user&quot; <br>    table=&quot;&#39;sys_user&#39;&quot; <br>    display-field=&quot;&#39;name&#39;&quot; <br>    value-field=&quot;&#39;name&#39;&quot; <br>    search-fields=&quot;&#39;name&#39;&quot; <br>    default-query=&quot;&#39;active=true&#39;&quot;&gt;<br>&lt;/sn-record-picker&gt;</pre><h3>📥 Handling Selection Changes</h3><p>To react when a user makes a selection, use the on-change callback or listen for the field.change event.</p><h3>Option 1: Using $scope.$on</h3><pre>$scope.$on(&quot;field.change&quot;, function(evt, parms) {<br>    if (parms.field.name === &#39;user&#39;) {<br>        c.selectedUser = parms.newValue;<br>        spUtil.addInfoMessage(&quot;Selected User: &quot; + c.selectedUser);<br>    }<br>});</pre><h3>Option 2: Using on-change (Cleaner)</h3><pre>&lt;sn-record-picker <br>    on-change=&quot;c.userSelected()&quot; <br>    table=&quot;&#39;sys_user&#39;&quot; <br>    display-field=&quot;&#39;name&#39;&quot; <br>    field=&quot;c.field&quot;&gt;<br>&lt;/sn-record-picker&gt;</pre><pre>c.userSelected = function(){<br>    console.log(&quot;User selected:&quot;, c.field.value);<br>};</pre><h3>👥 Multiple Record Selection</h3><p>Want users to select <em>more than one</em> record? Enable multiple=true.</p><h3>HTML:</h3><pre>&lt;sn-record-picker <br>    field=&quot;selectedUsers&quot; <br>    table=&quot;&#39;sys_user&#39;&quot; <br>    display-field=&quot;&#39;name&#39;&quot; <br>    value-field=&quot;&#39;sys_id&#39;&quot; <br>    search-fields=&quot;&#39;name&#39;&quot; <br>    default-query=&quot;&#39;active=true&#39;&quot; <br>    multiple=&quot;true&quot;&gt;<br>&lt;/sn-record-picker&gt;</pre><h3>Client Script:</h3><pre>$scope.$on(&quot;field.change&quot;, function(evt, parms) {<br>    if (parms.field.name === &#39;selectedUsers&#39;) {<br>        $scope.selectedUsers = parms.newValue;<br>        console.log(&quot;Selected user sys_ids:&quot;, $scope.selectedUsers);<br>    }<br>});</pre><blockquote><em>⚠ Note: </em><em>parms.newValue will now be an array of sys_ids.</em></blockquote><h3>⚡ Performance: Caching Results</h3><p>To improve performance and avoid redundant queries, use the options attribute to enable caching.</p><h3>HTML:</h3><pre>&lt;sn-record-picker <br>    options=&quot;c.options&quot; <br>    table=&quot;&#39;sys_user&#39;&quot; <br>    display-field=&quot;&#39;name&#39;&quot; <br>    field=&quot;c.field&quot;&gt;<br>&lt;/sn-record-picker&gt;</pre><h3>Client Script:</h3><pre>c.options = {<br>    cache: true<br>};</pre><h3>🧯 Pro Tip: ACLs Can Break the Picker</h3><p>The sn-record-picker uses ServiceNow&#39;s Table API under the hood, which strictly obeys ACLs. If the current user cannot read the table or fields you’re targeting, the picker may appear broken (e.g., infinite loading spinner).</p><p><strong>Always verify ACLs and visibility on the table and fields involved.</strong></p><h3>🎯 Conclusion</h3><p>The sn-record-picker is an indispensable directive when building custom widgets in the Service Portal. It’s intuitive for users and extremely flexible for developers.</p><p>By mastering attributes like multiple, on-change, default-query, and display-fields, you can offer your users a smooth and powerful record selection experience.</p><h3>🙌 Found this helpful?</h3><p>If you found this post useful, consider sharing it with your fellow ServiceNow developers or bookmarking it for later. Let me know in the comments how you’re using sn-record-picker in your projects!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=281f739933cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Discovery Schedule IP Analysis with ServiceNow’s DiscoveryAPI]]></title>
            <link>https://debendudas.medium.com/automating-discovery-schedule-ip-analysis-with-servicenows-discoveryapi-469bfe95b5a4?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/469bfe95b5a4</guid>
            <category><![CDATA[itom]]></category>
            <category><![CDATA[servicenow-discovery]]></category>
            <category><![CDATA[cmdb]]></category>
            <category><![CDATA[servicenow]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 06:55:22 GMT</pubDate>
            <atom:updated>2024-10-29T06:55:22.320Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you spending countless hours managing IP addresses and tracking which ones are being discovered by your Configuration Items (CIs)? 🤔 If you’re involved in CMDB management, you know how crucial yet challenging it can be to keep tabs on successful and failed discoveries. But what if I told you there’s a way to automate this process? 🤯</p><p>Enter the <a href="https://docs.servicenow.com/csh?topicname=c_DiscoveryAPIScopedAPI.html&amp;version=latest">DiscoveryAPI</a> – a powerful tool in the ServiceNow arsenal 🛠️ that can significantly streamline your IP address analysis. With a variety of methods at your disposal, the DiscoveryAPI can be a game-changer for your CMDB team. 💡</p><p>One such method is reportCiStatus, which provides a summary of CI Discovery status using a specific Discovery Status sys_id. This method can be a lifesaver ⛑️ when it comes to automating the tracking of IP addresses.</p><p>📜 Here’s a script that demonstrates how to use reportCiStatus to automate the analysis of discovery schedules:</p><pre>// Initialize the discoveryStatus variable with the sys_id of the discovery status record<br>var discoveryStatus = &quot;1d9962833319de105bf033a45d5c7b39&quot;; // Change the sys_id with your Discovery Status record&#39;s sys_id<br><br>// Create arrays to hold successfully discovered and errored IP addresses<br>var successFulIpAddress = [];<br>var errorIpAddress = [];<br><br>// Retrieve an array of CI status report objects for the given discovery status<br>var ipResultObjArray = sn_discovery.DiscoveryAPI.reportCiStatus(discoveryStatus);<br><br>// Iterate over the array of CI status report objects<br>for(var i = 0; i &lt; ipResultObjArray.length; i++) {<br>    // Extract the IP address from the current CI status report object<br>    var ipAddress = ipResultObjArray[i].getIpAddress();  <br><br>    // Check the operation status of the current CI and categorize the IP address accordingly<br>    if(ipResultObjArray[i].getCiOperationStatus() == &quot;Successful&quot;){<br>        // If the CI operation status is &quot;Successful&quot;, add the IP address to the successFulIpAddress array<br>        successFulIpAddress.push(ipAddress.toString());<br>    }else{<br>        // If the CI operation status is not &quot;Successful&quot;, add the IP address to the errorIpAddress array<br>        errorIpAddress.push(ipAddress.toString());<br>    }<br>}<br><br>// Instantiate an ArrayUtil object to perform array operations<br>var arrayUtil = new ArrayUtil();<br><br>// Remove duplicate entries from the successFulIpAddress array<br>var uniquesuccessFulIpAddress = arrayUtil.unique(successFulIpAddress);<br><br>// Remove duplicate entries from the errorIpAddress array<br>var uniqueErrorIpAddress = arrayUtil.unique(errorIpAddress);<br><br>// Log the total number of successfully discovered IP addresses and the list of unique addresses<br>gs.print(&quot;Total Number of IP Addresses Successfully Discovered: &quot; + successFulIpAddress.length);<br>gs.print(successFulIpAddress);<br><br>gs.print(&quot;------------------------------------------------------------------------------&quot;);<br><br>// Log the total number of IP addresses that failed to be discovered and the list of unique errored addresses<br>gs.print(&quot;Total Number of IP Addresses that Failed to Discovered: &quot; + errorIpAddress.length);<br>gs.print(uniqueErrorIpAddress);</pre><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*EOrcPPv3wdZg_t797rBYyQ.png" /></figure><p>With this script, you can easily identify which IP addresses have been successfully discovered ✔️ and which have not ❌, allowing for quick action and resolution. No more manual checks, no more wasted time ⏳. It’s all about efficiency and accuracy! ✅</p><p>If you’re looking to improve your CMDB accuracy and save time on IP address management, give this script a try and see the difference it makes! 💪</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=469bfe95b5a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ServiceNow spModal — User Input]]></title>
            <link>https://debendudas.medium.com/servicenow-spmodal-user-input-1ab14c752a25?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ab14c752a25</guid>
            <category><![CDATA[spmodal]]></category>
            <category><![CDATA[widget]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[service-portal]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Sun, 08 Sep 2024 08:11:33 GMT</pubDate>
            <atom:updated>2024-09-08T08:11:33.620Z</atom:updated>
            <content:encoded><![CDATA[<h3>ServiceNow spModal — User Input</h3><p>🚀 Elevate Your ServiceNow Experience with Interactive User Input! 🚀</p><p>Are you looking to enhance your ServiceNow user interface with dynamic input capabilities? Look no further! With the power of <strong><em>spModal</em></strong>, you can seamlessly integrate user input prompts for more interactive and responsive applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*Gc9ipIpRwuZzO5IZOfopqw.png" /></figure><h3>🔍 Dive into the Code:</h3><p>Let’s break down how you can leverage spModal to capture user inputs effectively:</p><h4>🔘 HTML:</h4><pre>&lt;button ng-click=&quot;c.onPrompt()&quot; class=&quot;btn btn-default&quot;&gt;<br> Prompt<br>&lt;/button&gt;</pre><p>Create a simple button in your Service Portal widget that triggers the input prompt function.</p><h4>🔘 Client Script:</h4><pre>c.onPrompt = function() {<br> spModal.open({<br> title: &quot;Rejection reason&quot;,<br> message: &quot;Please enter the reason to reject this:&quot;,<br> input: true,<br> buttons: [<br> {label: &#39;Cancel&#39;, cancel: true},<br> {label: &#39;Reject&#39;, primary: true}<br> ]<br> }).then(function(response) {<br> c.inputField = response;<br> })<br>}</pre><p>The script awaits user interaction, and upon receiving input, it captures the response for further processing.</p><p>Here the <strong><em>input = true </em></strong>is the main parameter which enables the user prompt.</p><h3>🌟 Why It’s a Game-Changer:</h3><h4>📊 Enhanced User Engagement:</h4><p>By prompting users for input, you create a more interactive experience that keeps them engaged.</p><h4>🔄 Streamlined Processes:</h4><p>Collect necessary information on the fly, making your processes more efficient and user-friendly.</p><h4>🛠️ Customizable Prompts:</h4><p>Tailor the prompts to fit the context of your application, ensuring relevance and clarity for users.<br>Embrace the future of ServiceNow interactions with spModal and watch your applications transform into dynamic powerhouses of efficiency and user satisfaction.</p><p>🔗 Want to learn more about optimizing your ServiceNow platform? Connect with me for insights and updates!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ab14c752a25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CMDB Health: A Guide to Key Performance Indicators and Metrics]]></title>
            <link>https://debendudas.medium.com/cmdb-health-a-guide-to-key-performance-indicators-and-metrics-a7893a415fdd?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7893a415fdd</guid>
            <category><![CDATA[cmdb]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[cmdb-health]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Thu, 29 Aug 2024 11:54:57 GMT</pubDate>
            <atom:updated>2024-08-29T11:54:57.605Z</atom:updated>
            <content:encoded><![CDATA[<p>Maintaining a healthy Configuration Management Database (CMDB) is critical for IT service management. A robust CMDB supports various ITIL processes and provides a centralized repository of information about IT assets, known as Configuration Items (CIs). To ensure your CMDB remains in top condition, it’s essential to monitor its health using Key Performance Indicators (KPIs) and metrics. In this article, we’ll delve into the three primary KPIs — correctness, compliance, and completeness — and how you can configure and utilize them for optimal CMDB health.</p><h3>Understanding CMDB Health KPIs</h3><p>CMDB Health is quantified through an aggregated score derived from three KPIs: correctness, compliance, and completeness. Each KPI comprises several sub-metrics, providing a detailed view of your CMDB’s state. By default, the base system includes all KPIs and metrics, but you have the flexibility to configure which ones are included in evaluations and dashboards.</p><h4>1) Completeness: No CI Left Behind</h4><p>Completeness measures whether all necessary information is present in the CMDB:</p><p><strong>a) Required Fields:</strong> This metric checks for mandatory fields that are not populated, tagging the CI as incomplete.</p><p><strong>b) Recommended Fields:</strong> It measures the percentage of CIs missing recommended information. You can set and unset recommended fields using scheduled jobs.</p><h4>2) Correctness: Ensuring Accurate Data</h4><p>The correctness KPI is an aggregate of metrics that measure the accuracy of the data in your CMDB. This includes:</p><p><strong>a) Orphan CIs:</strong> These are CIs that remain in the CMDB without a purpose, often due to being unintentionally left behind. Orphan CIs are identified based on specific criteria, such as lacking relationships or missing data.</p><p><strong>b) Staleness:</strong> Stale CIs haven’t been updated within a specified time frame. The default rule sets this period at 60 days, but it can be customized. Stale relationships are also flagged when they involve stale CIs.</p><p><strong>c) Duplicates:</strong> Duplicate CIs are identified using identification rules, and only independent CIs are evaluated. The count of duplicates is the total number of CIs in a set, minus one.</p><h4>3) Compliance: Adhering to Standards</h4><p>Compliance is based on CMDB audit runs and includes:</p><p><strong>a) Audit:</strong> This compares actual field values against expected values defined in audits. CIs must comply with all audits to pass the CMDB Health audit test.</p><h4>4) Relationships</h4><p>The health of CI relationships is assessed through non-configurable metrics, including duplicate, orphan, and stale relationships. Additional summaries report on non-compliant relationships based on suggested, containment, and hosting rules.</p><h3>Configuring CMDB Health</h3><p>To reflect your organization’s data health standards, CMDB Health is highly configurable. The CMDB Health Dashboard jobs are disabled by default, and you must enable them to start collecting health data.</p><h4>Step 1: Review and Adjust KPIs and Metrics</h4><p>· The first step to configure the KPIs and Metrics, by navigating to All &gt; Configuration &gt; Health Preference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*sGsDTI6Ze36BU_HLKSKUiA.png" /></figure><p>· Select Health Metrics on the right-hand side bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*LNPyqciLW0eOHGqe7hNywA.png" /></figure><p>· In the Select Metric drop-down list select the Completeness, Compliance, or the Correctness KPI and toggle Active to included or exclude that KPI and its associated metrics in CMDB Health analysis and reporting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*OtsaBY2VK-zjLcz_I4Oj2w.png" /></figure><h4>Step 2: Define Rules and Requirements</h4><p>For each KPI and metric, establish necessary rules and requirements for each KPIs:</p><h4>2.1. Completeness:</h4><p><strong>2.1.1. Required Fields</strong></p><p>To set up this configuration, it is necessary to update the necessary fields as mandatory by modifying their dictionary entries accordingly.</p><p>In this case, we are configuring Host name as a mandatory field for Server class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*cvrCCDiOUiU6-6yME7mmdw.png" /></figure><p><strong>2.1.2. Recommended Fields</strong></p><p>a) To set up the recommended fields, follow these steps:</p><p>i) Open the CI Class Manager by going to All &gt; Configuration &gt; CI Class Manager.</p><p>ii) Choose the specific CI Class you wish to configure, in this instance, the Server Class.</p><p>iii) Proceed to Health &gt; Completeness &gt; Recommended Fields.</p><p>iv) Here, select the fields you wish to mark as recommended, such as Location and Serial Number for the Server Class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ogA2ci7h_5NPrBXRxf1y5w.png" /></figure><h4>2.2. Compliance:</h4><p><strong>2.2.1. Audit</strong></p><p>To configure this Metrics, firstly we need to create a Certification Filter, where we will define the conditions to select the CIs for which Audit operation should perform.</p><p>i) Open the CI Class Manager by going to All &gt; Configuration &gt; CI Class Manager.</p><p>ii) Choose the specific CI Class you wish to configure, in this instance, the Server Class.</p><p>iii) Proceed to Health &gt; Compliance &gt; Certification Filter and create a Certification Filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*feUIWRvBS_2cbMPvZQrEKw.png" /></figure><p>Next step is to create a Certification Template, which will contain all the required checks to perform in the Audit.</p><p>iv) Proceed to Health &gt; Compliance &gt; Certification Template and create a Certification Template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*bA1axctCYuGuGGdCKGaxpA.png" /></figure><p>Next step is to create Audit.</p><p>v) Proceed to Health &gt; Compliance &gt; Audit and create Audit records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*APntVtn0tqB3xWfoYmLv8Q.png" /></figure><h4>2.3. Correctness:</h4><p><strong>2.3.1. Orphan Rule</strong></p><p>To configure this KPI, we need to create Orphan Rules by following steps:</p><p>i) Open the CI Class Manager by going to All &gt; Configuration &gt; CI Class Manager.</p><p>ii) Choose the specific CI Class you wish to configure, in this instance, the Server Class.</p><p>iii) Proceed to Health &gt; Correctness &gt; Orphan Rule.</p><p>iv) Click on New button and create a new Orphan Rule.</p><p>v) In this case, we are configuring the Orphan rule in such a way that if a Server CI’s Operational status is Non-Operational and it does not have any relationship with any class then the CI should be identified as an Orphan CI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*wBzNrBInpDxh5hTLOY-4sw.png" /></figure><p><strong>2.3.2. Staleness Rule</strong></p><p>To configure this KPI, we need to create Staleness Rules by following steps:</p><p>i) Open the CI Class Manager by going to All &gt; Configuration &gt; CI Class Manager.</p><p>ii) Choose the specific CI Class you wish to configure, in this instance, the Server Class.</p><p>iii) Proceed to Health &gt; Correctness &gt; Staleness Rule.</p><p>iv) Click on New button and create a new Orphan Rule.</p><p>v) In this case, we are configuring the Staleness rule with Effective Duration as 30 days hence, if a CI haven’t updated in last 30 days, then it should be identified as an Stale CI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*5GRYhvTlykrq68RE0Y2-pw.png" /></figure><h4>Step 3: Create Health Inclusion Rules</h4><p>Create health inclusion rules to determine which CIs are included in health calculations.</p><p>a) To set up the Health Inclusion Rules, follow these steps:</p><p>i) Open the CI Class Manager by going to All &gt; Configuration &gt; CI Class Manager.</p><p>ii) Proceed to Health &gt; Health Inclusion Rules.</p><p>iii) Select the Active Record Condition and Metrics to follow this Health Inclusion Rule.</p><p>In this case, we are setting up a health inclusion rule for all CI classes. Only CIs with Install Status and Operational Status not set to ‘Retire’ will be included in the CMDB Health Calculation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*QTUt2_F2Sc5IAMmKI9ElbQ.png" /></figure><h4>Step 4: Adjust System Properties</h4><p>Review and modify <a href="https://docs.servicenow.com/csh?topicname=r_CMDBHealthProperties.html&amp;version=latest">CMDB Health system properties</a> as needed.</p><h4>Step 5: Enable Health Dashboard Jobs</h4><p>Activate the Health Dashboard jobs for the KPIs you want to monitor and report.</p><p>There are multiple places from where you can enable the CMDB Health Dashboard Jobs such as — Health Preference, CMDB Dashboard — CMDB View.</p><p>In this case, we are enabling the schedule jobs from Health Preference.</p><p>· Navigate to All &gt; Configuration &gt; Health Preference.</p><p>· Select Scheduled Jobs on the right-hand side bar.</p><p>· Make the Active field True for the KPIs you want to activate.</p><p>· In this case, we activated all schedule jobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*lgK--TVWxBavmfsv36_IGg.png" /></figure><h3>CMDB Workspace</h3><p>CMDB Workspace provides an interactive user interface for CMDB activities. The Management view offers CMDB Admins rapid access to essential management tools and provides in-depth insights into the health and activities of the CMDB.</p><p>For viewing CMDB Health navigate to CMDB Workspace &gt; Management &gt; CMDB Health</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*d8Toab3BxQYQPEHjg4j0Bg.png" /></figure><h3>Conclusion</h3><p>By effectively configuring and monitoring the KPIs and metrics of CMDB Health, you can ensure your CMDB remains a reliable resource for IT service management. Regularly reviewing and adjusting settings will help you maintain a comprehensive and accurate CMDB, supporting your organization’s IT infrastructure and services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7893a415fdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Repeaters in ServiceNow]]></title>
            <link>https://debendudas.medium.com/how-to-use-repeaters-in-servicenow-81c9ea55c849?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/81c9ea55c849</guid>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[ui-builder]]></category>
            <category><![CDATA[repeater]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 17:31:01 GMT</pubDate>
            <atom:updated>2024-08-17T17:31:01.910Z</atom:updated>
            <content:encoded><![CDATA[<p>When it comes to creating dynamic and scalable user interfaces in ServiceNow, the repeater component within the UI Builder is your go-to tool. It’s like having a magic wand that can clone your components, populating them with data from a resource, and arrange them neatly for your users. Let’s break down how you can utilize repeaters to elevate your ServiceNow experiences.</p><h3>The Magic of Repeaters</h3><p>Imagine a simple loop in programming that can iterate over a set of data and replicate UI components for each piece of data. That’s what the repeater component does in the UI Builder. It works with arrays or arrays of objects, such as <em>[{“name”: “Workspace”, “number”: “SN0001”},{“name”: “Portal” , “number”: “SN0002”}]</em>, to repeat the content inside it for each item. This feature is incredibly useful for binding values to a data array property within your UI components.</p><p>For example, if you wish to display a list of records by their name and number, you can bind the name field to the repeater using <em>@item.value.name</em> and the number field using <em>@item.value.number</em>. The repeater will then ensure that each record is displayed correctly.</p><h3>Let’s explore the practical application of Repeaters through a specific use case.</h3><p><strong>Use Case: </strong>Our objective is to display a series of active incidents assigned to you, each represented by a card. While the design of each card remains consistent, the content within will dynamically change to reflect the details of each incident.</p><p>Below, you’ll find a visual representation of the intended outcome.</p><figure><img alt="Visual representation of the intended outcome" src="https://cdn-images-1.medium.com/max/926/1*B5pQ3tm_xhn1gkuj6iEEUg.png" /><figcaption>Visual representation of the intended outcome</figcaption></figure><h3>Step-by-Step: Implementing Repeaters</h3><h4>1. Starting Off</h4><p>Begin by navigating to `<em>All &gt; Now Experience Framework &gt; UI Builder</em>` in your ServiceNow instance.</p><figure><img alt="Navigating to UI Builder" src="https://cdn-images-1.medium.com/max/940/1*T3-CWOInC9ljGoDGPeJd4g.png" /><figcaption>Navigating to UI Builder</figcaption></figure><h4>2. Creating or Opening an Experience</h4><p>If you’re starting fresh, select `<em>+ Create</em>` to build a new experience. For guidance on crafting experiences, refer to the documentation on configuring user interactions in UI Builder.</p><figure><img alt="Creating new experience" src="https://cdn-images-1.medium.com/max/821/1*mLUWCvdjwzAf60Oqu_BwGw.png" /><figcaption>Creating new experience</figcaption></figure><p>Alternatively, you may choose to enhance an existing experience by incorporating the repeater component where needed.</p><h4>3. Editing Your Page</h4><p>Once you’ve got a page ready (or if you need to create one, check out the ServiceNow documentation on creating a page in UI Builder), it’s time to edit it and add some dynamic content.</p><h4>4. Configuring Data Source</h4><p>Your repeater needs data to work with. Add a data resource, like the `<em>Look Up Multiple Records</em>` data resource and configure it to pull from the Incident table.</p><p>Click on the `<em>Data</em>`</p><figure><img alt="Configuring Data Source — 1" src="https://cdn-images-1.medium.com/max/901/1*huT53WTuUt6rW7zpDbZvCw.png" /><figcaption>Configuring Data Source — 1</figcaption></figure><p>To begin, navigate to the Global section and select `<em>Look up multiple records</em>`, then click ‘<em>Add</em>.’ Alternatively, you can quickly locate this option by using the search bar.</p><figure><img alt="Configuring Data Source — 2" src="https://cdn-images-1.medium.com/max/940/1*KmSzH6KPxeO5CmR2uHhKqA.png" /><figcaption>Configuring Data Source — 2</figcaption></figure><p>Set your parameters such as ‘Table,’ ‘Condition,’ ‘Return fields,’ ‘Order by,’ and so on. On the right side of the screen, you’ll be able to view the results retrieved by the data source.</p><figure><img alt="Configuring Data Source — 3" src="https://cdn-images-1.medium.com/max/940/1*ijhKfYywmf5ccShGbPTuIA.png" /><figcaption>Configuring Data Source — 3</figcaption></figure><p>Here is the specific condition we’re applying to our use case:</p><figure><img alt="Configuring Data Source — 4" src="https://cdn-images-1.medium.com/max/940/1*ch67NA-9CTc37Ei7RPhDbg.png" /><figcaption>Configuring Data Source — 4</figcaption></figure><p>Your data source is now configured and ready to go. You can proceed with crafting the layout for your interface.</p><h4>5. Preparing the Layout</h4><p>Now, let’s design the layout for a single card that will be replicated in our repeater. In this instance, we are creating a layout that will display the Number, Short Description, and Priority of each Incident.</p><figure><img alt="Preparing the Layout — 1" src="https://cdn-images-1.medium.com/max/689/1*bBt9SzRCJn11xepfXyfKtA.png" /><figcaption>Preparing the Layout — 1</figcaption></figure><p>Unleash your creativity to craft the card layout. Here’s the layout I’ve employed for our purpose:</p><figure><img alt="Preparing the Layout — 2" src="https://cdn-images-1.medium.com/max/463/1*0lmJ7qUgV0RTv5nOZ60zQQ.png" /><figcaption>Preparing the Layout — 2</figcaption></figure><h4>6. Add and Configure the Repeater</h4><p>Next, add the Repeater component onto your page and place your newly designed card component within the repeater’s scope. Proceed to link the data source you’ve just created to the repeater to ensure dynamic content population.</p><figure><img alt="Add and Configure the Repeater" src="https://cdn-images-1.medium.com/max/940/1*Pey47hesalkKeUg6sR8fQw.png" /><figcaption>Add and Configure the Repeater</figcaption></figure><h4>7. Configure the Nested Components</h4><p>Having configured the repeater, it’s time to synchronize the card’s content with the data flowing through the repeater. To achieve this, bind the content to <em>@item</em>, which symbolizes each object being fed into the repeater.</p><figure><img alt="Configure the Nested Components — 1" src="https://cdn-images-1.medium.com/max/940/1*8lsNKXj9ZBzxeazzcYUUpQ.png" /><figcaption>Configure the Nested Components — 1</figcaption></figure><p>Keep in mind that the binding of <em>@item</em> data should correspond to the output structure of your data source. In our case, we are binding the Number using <em>@item.value.number.displayValue</em>, aligning with how the number data is presented in the data source output:</p><figure><img alt="Configure the Nested Components — 2" src="https://cdn-images-1.medium.com/max/875/1*-8w9xLF75qde3zMD95_k4Q.png" /><figcaption>Configure the Nested Components — 2</figcaption></figure><h4>8. Saving Your Work</h4><p>Hit `<em>Save</em>` to lock in your changes. Note that only the first value of your data set will be displayed on the stage.</p><h3>The Result: A Symphony of Data and Design</h3><figure><img alt="The Result: A Symphony of Data and Design" src="https://cdn-images-1.medium.com/max/939/1*jCiMJGOrMqjXDpIGU8eR_w.png" /><figcaption>The Result: A Symphony of Data and Design</figcaption></figure><p>By following these steps, you’ve just created a dynamic interface that not only looks good but is also efficient and scalable. Repeaters in UI Builder allow you to present data in a structured and user-friendly manner, whether it’s a list of tasks, incidents, or any other data set.</p><p>Remember, while the process might seem intricate at first, the beauty of ServiceNow’s UI Builder is in its ability to simplify complex tasks. With repeaters, you’re not just building an interface; you’re crafting an experience that can grow and adapt to your organization’s needs.</p><p>So go ahead, give it a try, and watch as your ServiceNow interfaces transform from static pages to vibrant, data-driven environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81c9ea55c849" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configurable Custom Card Widget for Service Portal in ServiceNow]]></title>
            <link>https://debendudas.medium.com/configurable-custom-card-widget-for-service-portal-in-servicenow-a5433fda0b71?source=rss-9c27be73a80f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5433fda0b71</guid>
            <category><![CDATA[employee-central]]></category>
            <category><![CDATA[servicenow]]></category>
            <category><![CDATA[service-portal]]></category>
            <category><![CDATA[custom-widget]]></category>
            <category><![CDATA[widget]]></category>
            <dc:creator><![CDATA[Debendu Das]]></dc:creator>
            <pubDate>Sat, 30 Sep 2023 06:10:21 GMT</pubDate>
            <atom:updated>2023-09-30T06:10:21.291Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>ServiceNow</strong> is a powerful platform that enables organizations to streamline their IT service management processes. One of its most impressive feature is the <strong>Service Portal</strong>, which enables you to design unique user experiences for your end users. In this guide, we’ll explore how to create a configurable custom card widget for Service Portal, giving you the flexibility to display information based on the widget options in a visually appealing and user-friendly manner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OUYrzFknc3VFh9aZHks5bw.gif" /><figcaption>Custom Card Widget</figcaption></figure><h3>Why Custom Card Widgets?</h3><p>Cards provide a visually engaging way to present data, making it easier for users to consume information quickly. Whether you want to display Knowledge articles, Quick links, or any other data in a card format, creating a configurable custom card widget can be a valuable addition to your ServiceNow instance.</p><h3>What Will We Build?</h3><p>We will build a custom card widget from scratch and add it to a Service Portal page. We will build the custom widget in such a way that, based on the widget options, we can configure the card content as well as add color and images to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAE7yzuE62J45p3iUXjHtA.png" /><figcaption>Custom Configurable Card Widget with Different Widget Options</figcaption></figure><p>Here is the list of things that can be easily modified using widget options:</p><ol><li>Heading and Description</li><li>Image</li><li>Feature tag</li><li>Background color</li><li>Featured color</li><li>Redirect URL</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*CS8mpXXaTc7FiAmvCYFt1Q.png" /><figcaption>Widgets Options</figcaption></figure><h3>Getting Started</h3><p>Before we dive into the code, make sure you have the necessary permissions and access to create custom widgets in your ServiceNow instance. Additionally, you should be familiar with HTML, JavaScript, and Service Portal’s client scripting.</p><h4>Step 1: Creating the Widget</h4><p>· Log in to your ServiceNow instance</p><p>· Navigate to “Service Portal” &gt; “Widgets”</p><p>· Click on “New” to create a new widget.</p><p>· Fill the Name, ID and Description of the Widget.</p><h4>Step 2: Write HTML Template</h4><pre>&lt;div class=&quot;card&quot; ng-style=&quot;{&#39;background&#39;: c.options.background_color}&quot;&gt;<br>  &lt;span ng-if=&quot;::c.options.feature&quot; class=&quot;tag&quot; ng-style=&quot;{&#39;background-color&#39;: c.options.feature_color}&quot; ng-class=&quot;{&#39;position-absolute&#39;: c.options.background_image &amp;&amp; c.options.background_image != &#39;&#39;}&quot;&gt;{{::c.options.feature}}&lt;/span&gt;<br>  &lt;div ng-if=&quot;::c.options.background_image&quot; class=&quot;bg&quot; ng-style=&quot;{&#39;background-image&#39;: c.image}&quot;&gt;&lt;/div&gt;<br>  &lt;h2 class=&quot;heading&quot;&gt;<br>   {{c.options.heading}}<br>  &lt;/h2&gt;<br>  &lt;p class=&quot;description&quot;&gt;<br>    {{c.options.description}}<br>  &lt;/p&gt;<br>  &lt;div&gt;<br>    &lt;a ng-href=&quot;{{c.options.redirect_url}}&quot; class=&quot;button&quot; ng-style=&quot;{&#39;border-color&#39;: c.options.feature_color, &#39;background-color&#39;: c.options.feature_color}&quot;&gt;<br>      Learn More &amp;nbsp;&amp;nbsp;&lt;span class=&quot;glyphicon glyphicon-menu-right&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;<br>    &lt;/a&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><h4>Step 3: Write CSS — SCSS</h4><pre>$secondary-color: #000000;<br>$text-color;<br>$text-muted;<br><br>.card{<br>  border-radius: 10px;<br>  padding: 20px;<br>  box-shadow: 0 0 1rem #e5e5e5;<br>  margin-bottom: 10px;<br>}<br><br>.tag{  <br>  background-color: $secondary-color;<br>  color: #ffffff;<br>  padding: 2px 8px;<br>  border-radius: 10px;<br>}<br><br>.heading{<br>  margin-top: 1.1rem;<br>  margin-bottom: 1.1rem;<br>  color:$text-color;<br>}<br><br>.description{<br>  color: $text-muted;<br>}<br><br>.button{<br>  color: #ffffff;<br>  background-color: #ffffff;<br>  padding: 0.5em 1em;<br>  border-radius: 6px;<br>  font-weight: 500;<br>  display: inline-flex;<br>  align-items: center;<br>  border: 2px solid $secondary-color;<br>  margin-top: 10px;<br>  box-shadow: inset 0 0 0 0 #ffffff;<br>  transition: ease-out 0.4s;<br>  cursor: pointer;<br><br>  &amp;:hover{<br>    background-color: #ffffff !important;<br>    color: #000000;<br>    box-shadow: inset 400px 0 0 0 #ffffff;<br>  }<br>}<br>.w-100{<br>  width: 100%;<br>}<br><br>.bg{<br>  height: 20rem;<br>  background: #ffffff;<br>  border-radius: 10px;<br>  background-position: center;<br>  background-repeat: no-repeat;<br>  background-size: cover;<br>}<br><br>.position-absolute{<br> position: absolute;<br>}</pre><h4>Step 4: Write Client Script</h4><pre>api.controller=function() {<br>  /* widget controller */<br>  var c = this;<br> c.image = c.options.background_image;<br> c.image = &quot;url(https://medium.com/&#39;&quot;%20+%20c.image%20+%20&quot;&#39;)&quot;;<br>};</pre><h4>Step 5: Set Up the Widget Options</h4><pre>[{&quot;hint&quot;:&quot;#000000&quot;,&quot;name&quot;:&quot;feature_color&quot;,&quot;section&quot;:&quot;Behavior&quot;,&quot;default_value&quot;:&quot;#000000&quot;,&quot;label&quot;:&quot;Feature Color&quot;,&quot;type&quot;:&quot;string&quot;},{&quot;name&quot;:&quot;heading&quot;,&quot;section&quot;:&quot;Data&quot;,&quot;default_value&quot;:&quot;Heading&quot;,&quot;label&quot;:&quot;Heading&quot;,&quot;type&quot;:&quot;string&quot;},{&quot;name&quot;:&quot;description&quot;,&quot;section&quot;:&quot;Data&quot;,&quot;default_value&quot;:&quot;Description&quot;,&quot;label&quot;:&quot;Description&quot;,&quot;type&quot;:&quot;string&quot;},{&quot;hint&quot;:&quot;https://www.google.com&quot;,&quot;name&quot;:&quot;redirect_url&quot;,&quot;section&quot;:&quot;Data&quot;,&quot;default_value&quot;:&quot;&quot;,&quot;label&quot;:&quot;Redirect URL&quot;,&quot;type&quot;:&quot;string&quot;},{&quot;name&quot;:&quot;background_image&quot;,&quot;section&quot;:&quot;Data&quot;,&quot;default_value&quot;:&quot;&quot;,&quot;label&quot;:&quot;Background Image&quot;,&quot;type&quot;:&quot;string&quot;},{&quot;hint&quot;:&quot;#FFFFFF&quot;,&quot;name&quot;:&quot;background_color&quot;,&quot;section&quot;:&quot;Behavior&quot;,&quot;default_value&quot;:&quot;#FFFFFF&quot;,&quot;label&quot;:&quot;Background Color&quot;,&quot;type&quot;:&quot;string&quot;},{&quot;name&quot;:&quot;feature&quot;,&quot;section&quot;:&quot;Data&quot;,&quot;label&quot;:&quot;Feature&quot;,&quot;type&quot;:&quot;string&quot;}]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nixIPoiSEW_nZJz3jFxDgQ.png" /><figcaption>Widget Options from Widget Editor</figcaption></figure><h4>Step 6: Add the Widget to a Page and provide the Widget Options</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AY99496PX6k9UyG7MwvFgA.png" /><figcaption>Adding the Widget to a Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6VEbUB1e323fvGCxrbCY7g.png" /><figcaption>Providing the Widget Options</figcaption></figure><h3>Conclusion</h3><p>Creating a configurable custom card widget for Service Portal in ServiceNow allows you to enhance the user experience by presenting data in an engaging and user-friendly way. By following the steps outlined in this article, you can harness the power of custom widgets to tailor your ServiceNow instance to your organization’s unique needs.</p><p>Now, start experimenting with different configurations and styles to create widgets that provide valuable insights and information to your users.</p><p>Happy widget-building! 🚀</p><p>Thank you for reading! If you found this article helpful, please <strong><em>clap</em></strong>, <strong><em>share</em></strong>, and leave your thoughts in the <strong><em>comments</em></strong> below. If you have any questions or need further assistance, feel free to reach out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5433fda0b71" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>