<?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 Create an error file when an import is failed in transform map. in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/create-an-error-file-when-an-import-is-failed-in-transform-map/m-p/3363567#M4378</link>
    <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement, wherein i am validating a field "account" ,through transform map and if that validation fails , the data from excel will not be loaded in Target Table ie Employee . Now this validation is written through Transform Map script and the data whose validation fails , is updated as false for the field "account" in "Employee " table , so for these scenarios where import is failed i want to generate an error file which will say that "3 out of 10 import is failed " and attach this file to the request generated.&lt;BR /&gt;Could anybody please help me with this.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Aug 2025 14:21:10 GMT</pubDate>
    <dc:creator>Mayuri S</dc:creator>
    <dc:date>2025-08-27T14:21:10Z</dc:date>
    <item>
      <title>Create an error file when an import is failed in transform map.</title>
      <link>https://www.servicenow.com/community/community-central-forum/create-an-error-file-when-an-import-is-failed-in-transform-map/m-p/3363567#M4378</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement, wherein i am validating a field "account" ,through transform map and if that validation fails , the data from excel will not be loaded in Target Table ie Employee . Now this validation is written through Transform Map script and the data whose validation fails , is updated as false for the field "account" in "Employee " table , so for these scenarios where import is failed i want to generate an error file which will say that "3 out of 10 import is failed " and attach this file to the request generated.&lt;BR /&gt;Could anybody please help me with this.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 14:21:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/create-an-error-file-when-an-import-is-failed-in-transform-map/m-p/3363567#M4378</guid>
      <dc:creator>Mayuri S</dc:creator>
      <dc:date>2025-08-27T14:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create an error file when an import is failed in transform map.</title>
      <link>https://www.servicenow.com/community/community-central-forum/create-an-error-file-when-an-import-is-failed-in-transform-map/m-p/3363596#M4379</link>
      <description>&lt;P&gt;You can write the Oncomplete transform script like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;    var iTable = new GlideRecord('sys_import_set_row'); // add your import set table
    iTable.addQuery('sys_import_set', source.sys_import_set)
    iTable.query();
    var total = iTable.getRowCount();

    iTable.addEncodedQuery('sys_import_state=error^sys_import_set=' + source.sys_import_set); // will query only current import 
    iTable.query();
    var errorRec = iTable.getRowCount();

    gs.info(errorRec + "out of " + total + " resulted in error");&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;** Note : Get Row count is not recommended, use glide Aggeregrate , this code is just for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 14:43:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/create-an-error-file-when-an-import-is-failed-in-transform-map/m-p/3363596#M4379</guid>
      <dc:creator>Raghav Sharma24</dc:creator>
      <dc:date>2025-08-27T14:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create an error file when an import is failed in transform map.</title>
      <link>https://www.servicenow.com/community/community-central-forum/create-an-error-file-when-an-import-is-failed-in-transform-map/m-p/3363672#M4381</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/191992"&gt;@Mayuri S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can use onComplete transform script for this and send email via gs.eventQueue() approach&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 15:34:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/create-an-error-file-when-an-import-is-failed-in-transform-map/m-p/3363672#M4381</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-08-27T15:34:24Z</dc:date>
    </item>
  </channel>
</rss>

