<?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 Script error - onBefore script of Robust Transform Map in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553333#M994244</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting an error on the execution of the onBefore script of Transform map. What could be the probable reason and solution for this?&lt;/P&gt;&lt;P&gt;PFB the image of the code and the error:&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="PriyankaGhosh_0-1683230063163.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259137iFD4FD9231E797599/image-size/medium?v=v2&amp;amp;px=400" alt="PriyankaGhosh_0-1683230063163.png" title="PriyankaGhosh_0-1683230063163.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriyankaGhosh_1-1683230131194.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259138iBB7A56646FCCDC70/image-size/medium?v=v2&amp;amp;px=400" alt="PriyankaGhosh_1-1683230131194.png" title="PriyankaGhosh_1-1683230131194.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2023 19:56:28 GMT</pubDate>
    <dc:creator>Priyanka Ghosh</dc:creator>
    <dc:date>2023-05-04T19:56:28Z</dc:date>
    <item>
      <title>Script error - onBefore script of Robust Transform Map</title>
      <link>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553333#M994244</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting an error on the execution of the onBefore script of Transform map. What could be the probable reason and solution for this?&lt;/P&gt;&lt;P&gt;PFB the image of the code and the error:&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="PriyankaGhosh_0-1683230063163.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259137iFD4FD9231E797599/image-size/medium?v=v2&amp;amp;px=400" alt="PriyankaGhosh_0-1683230063163.png" title="PriyankaGhosh_0-1683230063163.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriyankaGhosh_1-1683230131194.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259138iBB7A56646FCCDC70/image-size/medium?v=v2&amp;amp;px=400" alt="PriyankaGhosh_1-1683230131194.png" title="PriyankaGhosh_1-1683230131194.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 19:56:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553333#M994244</guid>
      <dc:creator>Priyanka Ghosh</dc:creator>
      <dc:date>2023-05-04T19:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script error - onBefore script of Robust Transform Map</title>
      <link>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553345#M994249</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/5794"&gt;@Priyanka Ghosh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the issue is with the Immediately Invoked function expression (line 105 - line 113), at line 113, you are passing the arguments as input &amp;amp; runID, since they are not defined anywhere, the javascript engine sets it to 'undefined' and hence the error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please pass the actual array and sysID in line 113.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If my answer has helped with your qestion, please mark it as correct and helpful&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 20:12:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553345#M994249</guid>
      <dc:creator>Karan Chhabra6</dc:creator>
      <dc:date>2023-05-04T20:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script error - onBefore script of Robust Transform Map</title>
      <link>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553360#M994348</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line no.- 98-103 are the OOB comments provided by servicenow. So as per that input, runID, payload, length are all provided to this onBefore script by default. Is it not what those comments mean?&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 20:42:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553360#M994348</guid>
      <dc:creator>Priyanka Ghosh</dc:creator>
      <dc:date>2023-05-04T20:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script error - onBefore script of Robust Transform Map</title>
      <link>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553379#M994356</link>
      <description>&lt;P&gt;Yes, sorry - I ignored it&lt;BR /&gt;Can you log the payload variable and check its value?&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 21:07:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553379#M994356</guid>
      <dc:creator>Karan Chhabra6</dc:creator>
      <dc:date>2023-05-04T21:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script error - onBefore script of Robust Transform Map</title>
      <link>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553398#M994362</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The error is in line no. 115. The payload seems to be a string and not a object. When you are trying to use payload.items.length, it is not able to parse this and hence you are getting an error. Check the value of payload and see that you are passing the object. Try to json.stringify and then json.parse in the function before using it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark the comment as a correct answer and helpful if this has answered your question.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 21:30:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553398#M994362</guid>
      <dc:creator>asifnoor</dc:creator>
      <dc:date>2023-05-04T21:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script error - onBefore script of Robust Transform Map</title>
      <link>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553793#M994572</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to draw your attention to the comments part from line-&amp;nbsp;&lt;SPAN&gt;98-103 . These are the OOB comments provided by servicenow which states that- status, reason and payload are the object of the array "input" which means it should be able to parse it. Isn't it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 10:01:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/script-error-onbefore-script-of-robust-transform-map/m-p/2553793#M994572</guid>
      <dc:creator>Priyanka Ghosh</dc:creator>
      <dc:date>2023-05-05T10:01:51Z</dc:date>
    </item>
  </channel>
</rss>

