<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Progress Bar - While waiting for REST response in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816369#M473295</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I came across this nice progress bar which i want to show on the form (Not on portal) while the user is waiting on a response from integration.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;ServiceNow Documentation &lt;A title="Progress Bar" href="https://developer.servicenow.com/dev.do#!/reference/libraries/orlando/now-components/now-progress-bar/api" rel="nofollow"&gt;LINK&lt;/A&gt;&lt;/P&gt;
&lt;DIV class="dps-component-detail-meta-row"&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Package: @servicenow/now-progress-bar&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-row"&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Release: Orlando&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/48321i34C7F913B0FB4769/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Integration is taking roughly 5 seconds to fetch the information and want to display this while waiting, Integration is triggered by an UI action. Can someone give me idea?&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Or something like this:&amp;nbsp;&lt;A href="https://codepen.io/chris22smith/pen/BbvYvZ" rel="nofollow"&gt;https://codepen.io/chris22smith/pen/BbvYvZ&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/48318i8391347C58ADE1D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Raghu.&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 22 Jul 2020 23:06:16 GMT</pubDate>
    <dc:creator>Raghu Loganatha</dc:creator>
    <dc:date>2020-07-22T23:06:16Z</dc:date>
    <item>
      <title>Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816369#M473295</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I came across this nice progress bar which i want to show on the form (Not on portal) while the user is waiting on a response from integration.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;ServiceNow Documentation &lt;A title="Progress Bar" href="https://developer.servicenow.com/dev.do#!/reference/libraries/orlando/now-components/now-progress-bar/api" rel="nofollow"&gt;LINK&lt;/A&gt;&lt;/P&gt;
&lt;DIV class="dps-component-detail-meta-row"&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Package: @servicenow/now-progress-bar&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-row"&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Release: Orlando&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/48321i34C7F913B0FB4769/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Integration is taking roughly 5 seconds to fetch the information and want to display this while waiting, Integration is triggered by an UI action. Can someone give me idea?&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;Or something like this:&amp;nbsp;&lt;A href="https://codepen.io/chris22smith/pen/BbvYvZ" rel="nofollow"&gt;https://codepen.io/chris22smith/pen/BbvYvZ&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="dps-component-detail-meta-install-label"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/48318i8391347C58ADE1D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Raghu.&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Jul 2020 23:06:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816369#M473295</guid>
      <dc:creator>Raghu Loganatha</dc:creator>
      <dc:date>2020-07-22T23:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816370#M473296</link>
      <description>&lt;P&gt;Please take a look at the below article:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.cavucode.com/blog/2015/4/8/fujiforty-hierarchicalworker-and-progress-viewer" rel="nofollow"&gt;http://www.cavucode.com/blog/2015/4/8/fujiforty-hierarchicalworker-and-progress-viewer&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 23:43:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816370#M473296</guid>
      <dc:creator>Prateek kumar</dc:creator>
      <dc:date>2020-07-22T23:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816371#M473297</link>
      <description>&lt;P&gt;I did notice this one, Just couldn't replicate. may be i am missing something. Do you mind giving me step by step solution for my requirement?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 23:52:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816371#M473297</guid>
      <dc:creator>Raghu Loganatha</dc:creator>
      <dc:date>2020-07-22T23:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816372#M473298</link>
      <description>&lt;P&gt;I haven't tried this personally, but let me see if I can implement this in my PDI.&lt;/P&gt;
&lt;P&gt;Will get back to you on this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 23:57:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816372#M473298</guid>
      <dc:creator>Prateek kumar</dc:creator>
      <dc:date>2020-07-22T23:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816373#M473299</link>
      <description>&lt;P&gt;thanks Prateek.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 02:41:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816373#M473299</guid>
      <dc:creator>Raghu Loganatha</dc:creator>
      <dc:date>2020-07-23T02:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816374#M473300</link>
      <description>&lt;P&gt;Here is what i tried in my instance and it is working.&lt;/P&gt;
&lt;P&gt;1. Create a UI Action.&lt;/P&gt;
&lt;P&gt;Name:&amp;nbsp;Show some Progress&lt;/P&gt;
&lt;P&gt;Client: Check&lt;/P&gt;
&lt;P&gt;onClick:&amp;nbsp;displayProgressWorker()&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function displayProgressWorker() {
    //instantiate new progress viewer
    var progressViewerDlg = 
        new GlideDialogWindow('hierarchical_progress_viewer');
    //define the AJAX script include to call
    progressViewerDlg.setPreference('sysparm_ajax_processor',
                                    'global.CAVURunner');
    //give the window a title
    progressViewerDlg.setTitle("CAVU Worker Progress");
    
    progressViewerDlg.on("executionComplete", function(trackerObj) {
        //optional callback on completion
        //see what's in trackerObj
        console.log(trackerObj);
        //use some data we passed back from the worker 
        //from 'this.tracker.updateResult({incidentsCreated: totalIncidents});'
        alert("All done creating " + 
              trackerObj.result.incidentsCreated + " incidents");
        //close the viewer
        progressViewerDlg.destroy();
    });
    
    //render the viewer
    progressViewerDlg.render();
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Create Client callable script include:&lt;/P&gt;
&lt;P&gt;Name:&amp;nbsp;CAVURunner&lt;/P&gt;
&lt;P&gt;API Name:&amp;nbsp;global.CAVURunner&lt;/P&gt;
&lt;P&gt;Client Callable: True&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var CAVURunner = Class.create();
CAVURunner.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
    start: function() {
        //instantiate worker
        var worker = new GlideScriptedHierarchicalWorker();
        //give it a name
        worker.setProgressName("CACU Worker");
        //run in the background so user can close progress if they get bored watching
        worker.setBackground(true);
        //call the script include worker and method
        worker.setScriptIncludeName("CAVUWorker");
        worker.setScriptIncludeMethod("runMe");
        worker.start();
        //get the worker id so we can track progress from the client
        var progressID = worker.getProgressID();
        return progressID;
    },
    
    type: 'CAVURunner'
});&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Create a script include:&lt;/P&gt;
&lt;P&gt;Name:&amp;nbsp;CAVUWorker&lt;/P&gt;
&lt;P&gt;API Name:&amp;nbsp;global.CAVUWorker&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;P&gt;In this i'm testing for creation of 20 incidents, you can parse the rest message and manipulate the function accordingly.&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var CAVUWorker = Class.create();
CAVUWorker.prototype = {
    
    initialize: function() {
        //get the tracker so we can send progress updates
        this.tracker = SNC.GlideExecutionTracker.getLastRunning();
    },
    
    runMe: function() {
        //let's take our time doing something like create 200 incidents
        var totalThings = 20;
        var incCounter = 1;
        for (var i = 1; i &amp;lt;= totalThings; i++) {
            if (totalThings &amp;lt; 100) {
                //determine how many percent to increment for each interval
                var intervalPercent = Math.floor(10 / totalThings);
                this.tracker.incrementPercentComplete(intervalPercent);
            }
            else {
                //determine number of things for one percent
                var onePercentInterval = Math.floor(totalThings / 100);
                if (i % onePercentInterval == 0) {
                    //increment one percent more
                    this.tracker.incrementPercentComplete(1);
                }
            }
            
            this._createIncident(i);
        }
        
        this.tracker.success("Finished creating " + totalIncidents + " incidents");
        //otherwise this.tracker.fail(msg);
        this.tracker.updateResult({incidentsCreated: totalIncidents});
    },
    
    _createIncident: function(num) {
        var gr = new GlideRecord("incident");
        gr.short_description = "testing " + num;
        gr.insert();
    },
    
    type: 'CAVUWorker'
};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/48316i7019D13816B98CF6/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Thanks&lt;/P&gt;
&lt;P&gt;Prateek&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 14:59:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816374#M473300</guid>
      <dc:creator>Prateek kumar</dc:creator>
      <dc:date>2020-07-23T14:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816375#M473301</link>
      <description>&lt;P&gt;Thanks So much Prateek!! That worked. Appreciate you taking time and helping out.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 17:59:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/1816375#M473301</guid>
      <dc:creator>Raghu Loganatha</dc:creator>
      <dc:date>2020-07-23T17:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Progress Bar - While waiting for REST response</title>
      <link>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/3420537#M1236189</link>
      <description>&lt;P&gt;Thanks Prateek.&amp;nbsp; Very interesting and helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its a shame some of the cool features like&amp;nbsp;hierarchical_progress_viewer are undocumented.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 21:21:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/progress-bar-while-waiting-for-rest-response/m-p/3420537#M1236189</guid>
      <dc:creator>bencollyer</dc:creator>
      <dc:date>2025-11-05T21:21:54Z</dc:date>
    </item>
  </channel>
</rss>

