<?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>post Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service in Developer blog</title>
    <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/ba-p/2283196</link>
    <description>&lt;P&gt;&lt;STRONG&gt;NOTE&lt;/STRONG&gt;: MY POSTINGS REFLECT MY OWN VIEWS AND DO NOT NECESSARILY REPRESENT THE VIEWS OF MY EMPLOYER, ACCENTURE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DIFFICULTY LEVEL:&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#808000"&gt;INTERMEDIATE&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Assumes a good knowledge and/or familiarity of&amp;nbsp;REST web services and Scripting in ServiceNow. Assumes having taken the class&amp;nbsp;&lt;A href="https://nowlearning.servicenow.com/lxp/en/now-platform/scripting-in-servicenow-fundamentals-on-demand?id=learning_course_prev&amp;amp;course_id=8375763b83566d10ec0ea230ceaad358" target="_self" rel="noopener noreferrer"&gt;SSNF&lt;/A&gt;&amp;nbsp;and has good intermediate level of knowledge and/or familiarity with Scripting in ServiceNow.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;
&lt;P dir="ltr"&gt;&lt;SPAN&gt;Some time ago I had to create a REST Web Message to retrieve information from a server. It occurred to me that there really had not been many examples written on this for ServiceNow. At least from the code perspective. So I thought I would share. This really isn't that complicated, and you should be able to glean what you need from the ServiceNow documentation, but I thought I would present a working example to play with anyway.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;&lt;SPAN&gt;In this example we will be using a test REST web service site called: 'cat-facts'. This will return a success string (true/false), and from 1 to any number we specify; of facts about cats.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;&lt;SPAN&gt;The idea here is to retrieve data from a REST Web Service and then parse the results into a JSON object for further use.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;&lt;SPAN&gt;What is needed:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;Web Service end-point. This will be:&amp;nbsp;&lt;/SPAN&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;A href="https://catfact.ninja/facts?limit=&amp;lt;&amp;lt;some" target="_blank" rel="noopener"&gt;https://catfact.ninja/facts?limit=&amp;lt;&amp;lt;some&lt;/A&gt;&amp;nbsp;number&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;If the number is not provided it is automatically assumed to be 10.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;ServiceNow REST Message&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Fix Script to run our test code and parse the results&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lab 1.1: Creating the Rest Message&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;Navigate to &lt;STRONG&gt;System Web Services &amp;gt; REST Message&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Click on the &lt;STRONG&gt;New&lt;/STRONG&gt; button to create a new REST Message.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Fill in the form with the following:&lt;/SPAN&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;: CatFacts&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Accessible from&lt;/STRONG&gt;: All application scopes&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;: Retrieve facts about cats!&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Endpoint&lt;/STRONG&gt;: &lt;A href="https://catfact.ninja/facts" target="_blank" rel="noopener"&gt;https://catfact.ninja/facts&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Authentication type: &lt;/STRONG&gt;No authentication&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Right-click on the form header and choose &lt;STRONG&gt;Save&lt;/STRONG&gt;. This will auto-generate four HTTP methods (get, put, post, delete). &amp;nbsp; We will only be using "get" for the purposes of this article.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sabell2012_0-1703804168873.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/316453i8C2224E7D89DDE7B/image-dimensions/847x434?v=v2" alt="sabell2012_0-1703804168873.png" title="sabell2012_0-1703804168873.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;4. In the HTTP Methods related list click on the "&lt;STRONG&gt;Default GET&lt;/STRONG&gt;" method.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;5. Change the &lt;/SPAN&gt;&lt;SPAN&gt;Endpoint &lt;/SPAN&gt;&lt;SPAN&gt;to: &lt;A href="https://catfact.ninja/facts?limit=&amp;lt;&amp;lt;some" target="_blank" rel="noopener"&gt;https://catfact.ninja/facts?limit=&lt;/A&gt;${limit}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;6. Right-click on the form header, and &lt;STRONG&gt;Save&lt;/STRONG&gt; your work.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;7. Scroll to the bottom of the form and from the &lt;STRONG&gt;Variable Substitution&lt;/STRONG&gt; related list click the &lt;STRONG&gt;New&lt;/STRONG&gt; button. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;8. Fill out the form with the following:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;a. &lt;/SPAN&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;SPAN&gt;: limit&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;b. &lt;STRONG&gt;Escape type&lt;/STRONG&gt;: No escaping&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;c. &lt;/SPAN&gt;&lt;STRONG&gt;Test Value&lt;/STRONG&gt;&lt;SPAN&gt;: 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;EM&gt;&amp;lt;-&amp;nbsp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM&gt;we will be pulling back five facts about cats.&lt;/EM&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;d. Click &lt;STRONG&gt;Submit&lt;/STRONG&gt; to save the variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sabell2012_3-1703804651276.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/316456iB2EDDD52E0DDE5C3/image-dimensions/831x679?v=v2" alt="sabell2012_3-1703804651276.png" title="sabell2012_3-1703804651276.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;9. Scroll down to the bottom of the Method form, and choose the "&lt;STRONG&gt;Test&lt;/STRONG&gt;" link under the related links. &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This will execute the REST Message with the number value of 5. &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;10. You will get a 200 result (success), and five facts about cats!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sabell2012_4-1703804734431.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/316457i3C82A79B4BF81BA1/image-dimensions/829x545?v=v2" alt="sabell2012_4-1703804734431.png" title="sabell2012_4-1703804734431.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Our REST Message is now ready to be consumed - a fancy programmer term meaning: "used".&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Lab 1.2: Fix Script to Run Consume the REST Message&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;So now comes the cool stuff. We will be creating code to execute the REST Message, and then convert the response to a JSON object so that we can actually make some use of it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;Navigate to &lt;STRONG&gt;Fix Scripts&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Click the &lt;STRONG&gt;New&lt;/STRONG&gt; button.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Fill out the form with the following:&lt;/SPAN&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;: Cat Facts&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;: Test script to consume the CatFacts REST Message&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Script&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var location = 'FS: CatFacts';
var webService = 'CatFacts';
var command = 'Default GET'; // case sensitive
var limit = 5;
var message = gs.getMessage('---&amp;gt; [{0}]\n', [location]);

try {
	var restMessage = new sn_ws.RESTMessageV2(webService, command);
	restMessage.setStringParameter('limit', parseInt(limit));
	var response = restMessage.execute(); // REST return
	var httpStatus = response.getStatusCode(); // response status code

	var responseBody = response.getBody(); // stringified JSON returned info
	var jsonBody = JSON.parse(responseBody); // turn it into a true JSON object

	// Now we can begin using the response
	message += gs.getMessage('\tResponseBody: {0}\n', [responseBody]);

	var facts = jsonBody.data;
	var success = httpStatus == 200;

	message += gs.getMessage('\tfacts.length: {0}\n', [facts]);
	message += gs.getMessage('\tjsonBody.success: {0}\n', [success]);
	message += 'Facts:\n';
	if (success) {
		for (var i = 0; i &amp;lt; facts.length; i++) {
			message += gs.getMessage('\t[{0}]: {1}\n', [i, facts[i].fact]);
		}
	}
}
catch(err) {
	gs.error('---&amp;gt; ERROR: ' + err);
}
gs.info(message);

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 60px;"&gt;&lt;SPAN&gt;4. Right-click on the form header and &lt;STRONG&gt;Save&lt;/STRONG&gt; your work.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 60px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sabell2012_8-1703805674456.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/316464i49805022EA26CA13/image-dimensions/826x545?v=v2" alt="sabell2012_8-1703805674456.png" title="sabell2012_8-1703805674456.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 60px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;5. Navigate to System Logs &amp;gt; System Log &amp;gt; All and filter Message for ---&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sabell2012_7-1703805632061.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/316462i00AB775E7D7D0F92/image-dimensions/841x557?v=v2" alt="sabell2012_7-1703805632061.png" title="sabell2012_7-1703805632061.png" /&gt;&lt;/span&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And there you have it! In this article I demonstrated:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;How to create a REST Message&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;How to add a variable to the REST Message method&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;How to test a REST Message method&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;How to call a REST Message from a script&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;How to use a variable in a REST Message from a script&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;How to parse the returned results into JSON from the REST Message&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;How to consume (a.k.a. use) the JSON results&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;Steven Bell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF9900"&gt;&lt;SPAN&gt;&lt;STRONG&gt;If you find this article helps you, don't forget to log in and mark it as "Helpful"!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sabell2012_0-1703794648636.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/316448i80EE0ED62DC439B4/image-size/medium?v=v2&amp;amp;px=400" alt="sabell2012_0-1703794648636.png" title="sabell2012_0-1703794648636.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&lt;SPAN&gt;Originally published on:&amp;nbsp;&lt;SPAN class="local-date"&gt;09-06-2016 01:50 AM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I updated the code, fixed broken links, and brought the article into alignment with my new formatting standard&lt;/P&gt;</description>
    <pubDate>Thu, 28 Dec 2023 23:31:09 GMT</pubDate>
    <dc:creator>sabell2012</dc:creator>
    <dc:date>2023-12-28T23:31:09Z</dc:date>
    <item>
      <title>Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/ba-p/2283196</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Some time ago I had to create a REST Web Message to retrieve information from a server. It occurred to me that there really had not been many examples written on this for ServiceNow. At least from the code perspective. So I thought I would share. This really isn't that complicated, and you should be able to glean what you need from the ServiceNow documentation, but I thought I would present a working example to play with anyway.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 23:31:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/ba-p/2283196</guid>
      <dc:creator>sabell2012</dc:creator>
      <dc:date>2023-12-28T23:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283197#M3994</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;When I ran the fix script in my Dev instance I received following error. Can you help me with this&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;PRE style="box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 12px; padding: 8.5px; margin-top: 0px; margin-bottom: 9px; line-height: 1.42857; word-break: break-all; word-wrap: break-word; color: #485563; border: 1px solid #cccccc; border-radius: 3px; background-color: #f5f5f5;"&gt;Evaluator: java.util.NoSuchElementException &amp;nbsp; &amp;nbsp; &amp;nbsp; Caused by error in Script Include: 'JSON' at line 145 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 142: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 143: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 144: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; decode: function(source) { ==&amp;gt; 145: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new SNC.JSONParse().decode(source); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 146: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 147: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 148: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: "JSON" &amp;nbsp; java.util.LinkedList.remove(LinkedList.java:788) java.util.LinkedList.removeFirst(LinkedList.java:134) java.util.LinkedList.pop(LinkedList.java:601) com.glide.script.JSONParse.handleObjectEnd(JSONParse.java:296) com.glide.script.JSONParse.tokenize(JSONParse.java:73) com.glide.script.JSONParse.jsFunction_decode(JSONParse.java:53) sun.reflect.GeneratedMethodAccessor489.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:597) org.mozilla.javascript.FunctionObject.callVarargs(FunctionObject.java:613) org.mozilla.javascript.FunctionObject.call(FunctionObject.java:457) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c899.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:145) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c900.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:158) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c2814.call(&amp;lt;refname&amp;gt;:13) org.mozilla.javascript.gen.c2814.exec(&amp;lt;refname&amp;gt;) com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:233) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:105) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:72) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:63) com.glide.script.Evaluator.evaluateString(Evaluator.java:91) com.glide.update.UpdateManager2.testFixScript(UpdateManager2.java:600) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.evaluateScript(ScriptFixXMLHttpProcessor.java:122) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.startWork(ScriptFixXMLHttpProcessor.java:100) com.glide.worker.AbstractProgressWorker.startAndWait(AbstractProgressWorker.java:86) com.glide.worker.ProgressWorker.startAndWait(ProgressWorker.java:52) com.glide.worker.AbstractProgressWorker.start(AbstractProgressWorker.java:67) com.snc.apps.ScriptFixXMLHttpProcessor.process(ScriptFixXMLHttpProcessor.java:77) com.glide.processors.XMLHttpProcessor.processJavaAJAX(XMLHttpProcessor.java:143) com.glide.processors.XMLHttpProcessor.process(XMLHttpProcessor.java:100) com.glide.processors.AProcessor.runProcessor(AProcessor.java:409) com.glide.processors.AProcessor.processTransaction(AProcessor.java:183) com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:165) com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:32) com.glide.sys.ServletTransaction.run(ServletTransaction.java:34) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) java.lang.Thread.run(Thread.java:682)&lt;BR style="box-sizing: border-box;" /&gt;Evaluator: java.util.NoSuchElementException &amp;nbsp; &amp;nbsp; &amp;nbsp; Caused by error in Script Include: 'JSON' at line 158 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 155:  &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3. Invalid JSON is accepted (member names not enclosed in quotes) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 156:  &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4. Bare encoded strings are decoded twice. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 157: */ ==&amp;gt; 158: JSON.parse = function(s) { return new JSON().decode(s); }; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 159: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 160:  &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 161:  &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Convert a JS object to a JSON string. &amp;nbsp; Note that this is not completely ES5 compatible: &amp;nbsp; java.util.LinkedList.remove(LinkedList.java:788) java.util.LinkedList.removeFirst(LinkedList.java:134) java.util.LinkedList.pop(LinkedList.java:601) com.glide.script.JSONParse.handleObjectEnd(JSONParse.java:296) com.glide.script.JSONParse.tokenize(JSONParse.java:73) com.glide.script.JSONParse.jsFunction_decode(JSONParse.java:53) sun.reflect.GeneratedMethodAccessor489.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:597) org.mozilla.javascript.FunctionObject.callVarargs(FunctionObject.java:613) org.mozilla.javascript.FunctionObject.call(FunctionObject.java:457) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c899.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:145) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c900.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:158) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c2814.call(&amp;lt;refname&amp;gt;:13) org.mozilla.javascript.gen.c2814.exec(&amp;lt;refname&amp;gt;) com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:233) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:105) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:72) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:63) com.glide.script.Evaluator.evaluateString(Evaluator.java:91) com.glide.update.UpdateManager2.testFixScript(UpdateManager2.java:600) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.evaluateScript(ScriptFixXMLHttpProcessor.java:122) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.startWork(ScriptFixXMLHttpProcessor.java:100) com.glide.worker.AbstractProgressWorker.startAndWait(AbstractProgressWorker.java:86) com.glide.worker.ProgressWorker.startAndWait(ProgressWorker.java:52) com.glide.worker.AbstractProgressWorker.start(AbstractProgressWorker.java:67) com.snc.apps.ScriptFixXMLHttpProcessor.process(ScriptFixXMLHttpProcessor.java:77) com.glide.processors.XMLHttpProcessor.processJavaAJAX(XMLHttpProcessor.java:143) com.glide.processors.XMLHttpProcessor.process(XMLHttpProcessor.java:100) com.glide.processors.AProcessor.runProcessor(AProcessor.java:409) com.glide.processors.AProcessor.processTransaction(AProcessor.java:183) com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:165) com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:32) com.glide.sys.ServletTransaction.run(ServletTransaction.java:34) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) java.lang.Thread.run(Thread.java:682)&lt;BR style="box-sizing: border-box;" /&gt;Evaluator: java.util.NoSuchElementException &amp;nbsp; &amp;nbsp; &amp;nbsp; Caused by error in script at line 13 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11: var responseBody = response.getBody(); // stringified JSON returned info &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12: &amp;nbsp; &amp;nbsp; &amp;nbsp; ==&amp;gt; &amp;nbsp; 13: var parsed = JSON.parse(responseBody); // turn it into a true JSON object &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15: // Now we can begin using the response &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16: gs.print(responseBody); &amp;nbsp; &amp;nbsp; &amp;nbsp; java.util.LinkedList.remove(LinkedList.java:788) java.util.LinkedList.removeFirst(LinkedList.java:134) java.util.LinkedList.pop(LinkedList.java:601) com.glide.script.JSONParse.handleObjectEnd(JSONParse.java:296) com.glide.script.JSONParse.tokenize(JSONParse.java:73) com.glide.script.JSONParse.jsFunction_decode(JSONParse.java:53) sun.reflect.GeneratedMethodAccessor489.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:597) org.mozilla.javascript.FunctionObject.callVarargs(FunctionObject.java:613) org.mozilla.javascript.FunctionObject.call(FunctionObject.java:457) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c899.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:145) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c900.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:158) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c2814.call(&amp;lt;refname&amp;gt;:13) org.mozilla.javascript.gen.c2814.exec(&amp;lt;refname&amp;gt;) com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:233) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:105) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:72) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:63) com.glide.script.Evaluator.evaluateString(Evaluator.java:91) com.glide.update.UpdateManager2.testFixScript(UpdateManager2.java:600) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.evaluateScript(ScriptFixXMLHttpProcessor.java:122) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.startWork(ScriptFixXMLHttpProcessor.java:100) com.glide.worker.AbstractProgressWorker.startAndWait(AbstractProgressWorker.java:86) com.glide.worker.ProgressWorker.startAndWait(ProgressWorker.java:52) com.glide.worker.AbstractProgressWorker.start(AbstractProgressWorker.java:67) com.snc.apps.ScriptFixXMLHttpProcessor.process(ScriptFixXMLHttpProcessor.java:77) com.glide.processors.XMLHttpProcessor.processJavaAJAX(XMLHttpProcessor.java:143) com.glide.processors.XMLHttpProcessor.process(XMLHttpProcessor.java:100) com.glide.processors.AProcessor.runProcessor(AProcessor.java:409) com.glide.processors.AProcessor.processTransaction(AProcessor.java:183) com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:165) com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:32) com.glide.sys.ServletTransaction.run(ServletTransaction.java:34) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) java.lang.Thread.run(Thread.java:682)&lt;BR style="box-sizing: border-box;" /&gt;Evaluator: java.util.NoSuchElementException &amp;nbsp; &amp;nbsp; &amp;nbsp; Caused by error in script at line -1 java.util.LinkedList.remove(LinkedList.java:788) java.util.LinkedList.removeFirst(LinkedList.java:134) java.util.LinkedList.pop(LinkedList.java:601) com.glide.script.JSONParse.handleObjectEnd(JSONParse.java:296) com.glide.script.JSONParse.tokenize(JSONParse.java:73) com.glide.script.JSONParse.jsFunction_decode(JSONParse.java:53) sun.reflect.GeneratedMethodAccessor489.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:597) org.mozilla.javascript.FunctionObject.callVarargs(FunctionObject.java:613) org.mozilla.javascript.FunctionObject.call(FunctionObject.java:457) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c899.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:145) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c900.call(sys_script_include.d2426c9ec0a8016501958bf2ac79c775:158) org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1227) org.mozilla.javascript.gen.c2814.call(&amp;lt;refname&amp;gt;:13) org.mozilla.javascript.gen.c2814.exec(&amp;lt;refname&amp;gt;) com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:233) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:105) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:72) com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:63) com.glide.script.Evaluator.evaluateString(Evaluator.java:91) com.glide.update.UpdateManager2.testFixScript(UpdateManager2.java:600) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.evaluateScript(ScriptFixXMLHttpProcessor.java:122) com.snc.apps.ScriptFixXMLHttpProcessor$ScriptFixWorker.startWork(ScriptFixXMLHttpProcessor.java:100) com.glide.worker.AbstractProgressWorker.startAndWait(AbstractProgressWorker.java:86) com.glide.worker.ProgressWorker.startAndWait(ProgressWorker.java:52) com.glide.worker.AbstractProgressWorker.start(AbstractProgressWorker.java:67) com.snc.apps.ScriptFixXMLHttpProcessor.process(ScriptFixXMLHttpProcessor.java:77) com.glide.processors.XMLHttpProcessor.processJavaAJAX(XMLHttpProcessor.java:143) com.glide.processors.XMLHttpProcessor.process(XMLHttpProcessor.java:100) com.glide.processors.AProcessor.runProcessor(AProcessor.java:409) com.glide.processors.AProcessor.processTransaction(AProcessor.java:183) com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:165) com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:32) com.glide.sys.ServletTransaction.run(ServletTransaction.java:34) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) java.lang.Thread.run(Thread.java:682)&lt;BR style="box-sizing: border-box;" /&gt;&lt;STRONG style="box-sizing: border-box;"&gt;[0:00:01.495] Total Time&lt;/STRONG&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Sep 2016 13:08:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283197#M3994</guid>
      <dc:creator>sagarAgarwal</dc:creator>
      <dc:date>2016-09-06T13:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283198#M3995</link>
      <description>&lt;P&gt;Sagar:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I'm not sure; I have not see that error before when working with this. &amp;nbsp; Is it consistent, does it happen every time? &amp;nbsp; I have attached my script to the article for download. &amp;nbsp; Give that a try and see if it works.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Sep 2016 14:01:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283198#M3995</guid>
      <dc:creator>sabell2012</dc:creator>
      <dc:date>2016-09-06T14:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283199#M3996</link>
      <description>&lt;P&gt;What version are you on? I think JSON.parse demands helsinki, but might be wrong.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;//Göran&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Sep 2016 16:12:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283199#M3996</guid>
      <dc:creator>Goran WitchDoc</dc:creator>
      <dc:date>2016-09-06T16:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283200#M3997</link>
      <description>&lt;P&gt;Goran:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Not sure, but I don't think that is the issue. &amp;nbsp; I have been using JSON for a couple of years+ in ServiceNow. &amp;nbsp; Fuji definitely had the libraries.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Steven.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Sep 2016 20:13:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283200#M3997</guid>
      <dc:creator>sabell2012</dc:creator>
      <dc:date>2016-09-06T20:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283201#M3998</link>
      <description>&lt;P&gt;Ahh mixed it all together from this blog post: &lt;A title="ECMAScript 5 in ServiceNow Helsinki!" __default_attr="5411" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content="ECMAScript 5 in ServiceNow Helsinki!" data-renderedposition="10_290_258_16" href="https://www.servicenow.com/community?id=community_blog&amp;amp;sys_id=585de229dbd0dbc01dcaf3231f9619db"&gt;ECMAScript 5 in ServiceNow Helsinki!&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;just remember "helsinki" from the title and something about JSON.parse was added as a class function, but just that part was with "recent release".&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Sep 2016 20:27:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283201#M3998</guid>
      <dc:creator>Goran WitchDoc</dc:creator>
      <dc:date>2016-09-06T20:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283202#M3999</link>
      <description>&lt;P&gt;Yeah, had forgotten that article. &amp;nbsp; Hmmm, maybe you are right. &amp;nbsp; I will have to go and see if I can find a Geneva or earlier instance, and play a bit. &amp;nbsp; Let you know.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I did these articles on Geneva:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG style="font-size: 16px; font-family: arial, helvetica, sans-serif; color: #666666;"&gt;&lt;A title="" _jive_internal="true" href="https://www.servicenow.com/groups/servicenow-user-group-us-tx-north-texas/blog/2016/01/26/mini-lab-using-ajax-and-json-to-send-objects-to-the-server" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #266fc8;"&gt;Mini-Lab: Using Ajax and JSON to Send Objects to the Server&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #666666; font-family: arial, helvetica, sans-serif; font-size: 16px;"&gt; - 1/26/2016&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, helvetica, sans-serif; font-size: 16px;"&gt;&lt;STRONG style="font-size: 16px; font-family: arial, helvetica, sans-serif; color: #666666;"&gt;&lt;A title="" _jive_internal="true" href="https://www.servicenow.com/groups/servicenow-user-group-us-tx-north-texas/blog/2016/01/28/mini-lab-syslog-writing-entries-into-the-system-log-using-ajax" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #266fc8;"&gt;Mini-Lab: Writing Entries Into the System Log Using Ajax and JSON&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #666666; font-family: arial, helvetica, sans-serif; font-size: 16px;"&gt; - 1/28/2016&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-size: 16px; font-family: arial, helvetica, sans-serif;"&gt;I didn't publish anything JSON before that, but I swear I used it waaay before that, and it wasn't a library port either. &amp;nbsp; &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Sep 2016 20:51:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283202#M3999</guid>
      <dc:creator>sabell2012</dc:creator>
      <dc:date>2016-09-06T20:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283203#M4000</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I was using Geneva instance.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;One more weird thing happened, when I tried to retrieve the update set you have attached in this post in my dev instance it was not getting added. Once I click on upload button its redirecting me to retrieved update sets list. I tried it to retrieve it in a fresh dev instance too but same issue, update set is not added in the list.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2016 09:08:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283203#M4000</guid>
      <dc:creator>sagarAgarwal</dc:creator>
      <dc:date>2016-09-07T09:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283204#M4001</link>
      <description>&lt;P&gt;Sagar:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;That XML was a direct to table file, not an update set. &amp;nbsp; &amp;nbsp; In other words when you upload it using Import XML it will end up in the Fix Scripts table. &amp;nbsp; Check there. &amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Okay, did a little research. &amp;nbsp; Looks like some things were actually in Geneva, not sure what patch. &amp;nbsp; Now, the interesting part. &amp;nbsp; JSON.stringify, and JSON.parse are both ECMA 5.1 and later! &amp;nbsp; Sooo, looks like you called it Goran!&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse" title="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse"&gt;JSON.parse() - JavaScript | MDN&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify" title="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify"&gt;JSON.stringify() - JavaScript | MDN&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Where does this leave you? &amp;nbsp; Well, there is a Polyfill for this. &amp;nbsp; You could implement that as a Script Include on your instance and see if that allows the example to work. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="http://bestiejs.github.io/json3/" title="http://bestiejs.github.io/json3/"&gt;JSON 3&lt;/A&gt; &amp;lt;-- JSON Polyfill definition with .parse and .stringify&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Awhile back I wrote an article on how to implement Polyfills in ServiceNow. &amp;nbsp; You might give it a try and see if it fixes the issue.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A title="Mini-Lab: Extending ServiceNow JavaScript Using ECMAScript 6 Polyfills" __default_attr="4767" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content="Mini-Lab: Extending ServiceNow JavaScript Using ECMAScript 6 Polyfills" data-renderedposition="428.9062194824219_7.997159004211426_474_15" href="https://www.servicenow.com/community?id=community_blog&amp;amp;sys_id=fd5d6629dbd0dbc01dcaf3231f961989"&gt;Mini-Lab: Extending ServiceNow JavaScript Using ECMAScript 6 Polyfills&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;Clarification&lt;/STRONG&gt;: &amp;nbsp; You will need to implement the JSON 3 polyfill to possibly get this to work. &amp;nbsp; My article does not describe the JSON implementation, just a how to do polyfills in ServiceNow.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Steven.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2016 11:00:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283204#M4001</guid>
      <dc:creator>sabell2012</dc:creator>
      <dc:date>2016-09-07T11:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283205#M4002</link>
      <description>&lt;P&gt;can't Sagar use the JSON.encode() and JSON.decode? those works in Geneva right? &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2016 13:34:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283205#M4002</guid>
      <dc:creator>Goran WitchDoc</dc:creator>
      <dc:date>2016-09-07T13:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283206#M4003</link>
      <description>&lt;P&gt;Goran:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Yeah, but not so easy to use in this case. &amp;nbsp; You would still need to parse the stringified JSON somehow. &amp;nbsp; Decode won't work on it I believe.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Steven.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Sep 2016 21:40:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283206#M4003</guid>
      <dc:creator>sabell2012</dc:creator>
      <dc:date>2016-09-08T21:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283207#M4004</link>
      <description>&lt;P&gt;Thanks Steve Bell for this step-by-step example, it's really helpful.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Remark: I think that in the point 6, you wanted to say "&lt;STRONG&gt;&lt;A title="k-external-small" class="jive-link-external-small" href="http://catfacts-api.appspot.com/api/facts" rel="nofollow" target="_blank"&gt;http://catfacts-api.appspot.com/api/facts&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/STRONG&gt;number=5" and not "&lt;STRONG&gt;&lt;A title="k-external-small" class="jive-link-external-small" href="http://www.programmableweb.com/api/cat-facts" rel="nofollow" target="_blank"&gt;http://www.programmableweb.com/api/cat-facts&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/STRONG&gt;number=${number}", don't you ? The latter returns HTML content and not JSON&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/181637i669474B45F6FD423/image-size/large?v=v2&amp;amp;px=999" title="html-content.png" alt="html-content.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;while the other return JSON content as expected&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/181639i1C688BA2FB3D684C/image-size/large?v=v2&amp;amp;px=999" title="JSON-content.png" alt="JSON-content.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Sep 2016 07:13:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283207#M4004</guid>
      <dc:creator>Ximizu</dc:creator>
      <dc:date>2016-09-12T07:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283208#M4005</link>
      <description>&lt;P&gt;Ximizu:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thank you, and yes! &amp;nbsp; The screen shot wasn't completely accurate either. &amp;nbsp; Great catch, thank you! &amp;nbsp; The article has been corrected.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;BR /&gt;Steven.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Sep 2016 12:52:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283208#M4005</guid>
      <dc:creator>sabell2012</dc:creator>
      <dc:date>2016-09-12T12:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mini-Lab: Retrieving and Parsing the JSON Results From a REST Web Service</title>
      <link>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283209#M4006</link>
      <description>&lt;P&gt;Hello Steve,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;This post was really awesome as very new to this.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I have followed your step and but got an issue.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I am not able to get this in json format but http status is 200.What might be the issue here.Please help..&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/181641i52258283DEBD9F67/image-size/large?v=v2&amp;amp;px=999" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Feb 2017 06:26:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-blog/mini-lab-retrieving-and-parsing-the-json-results-from-a-rest-web/bc-p/2283209#M4006</guid>
      <dc:creator>salu</dc:creator>
      <dc:date>2017-02-17T06:26:39Z</dc:date>
    </item>
  </channel>
</rss>

