<?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 How to update records in target table using transform map in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582166#M495771</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to update records , I am using coalesce on name field but i want to update only active records in target table.&lt;/P&gt;&lt;P&gt;how can i achieve that. I am using&amp;nbsp; before transform script ,but it is not updating the records where active is true and name field has a duplicate(one as active=false).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(action == "insert"){&lt;BR /&gt;ignore = true;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(action=="update" &amp;amp;&amp;amp; target.active == true){&lt;BR /&gt;action="update";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 04:23:04 GMT</pubDate>
    <dc:creator>Priya75</dc:creator>
    <dc:date>2023-06-08T04:23:04Z</dc:date>
    <item>
      <title>How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582166#M495771</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to update records , I am using coalesce on name field but i want to update only active records in target table.&lt;/P&gt;&lt;P&gt;how can i achieve that. I am using&amp;nbsp; before transform script ,but it is not updating the records where active is true and name field has a duplicate(one as active=false).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(action == "insert"){&lt;BR /&gt;ignore = true;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(action=="update" &amp;amp;&amp;amp; target.active == true){&lt;BR /&gt;action="update";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 04:23:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582166#M495771</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T04:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582179#M495773</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do this&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	if(action == "insert"){
		ignore = true;
	}
	if(action == "update" &amp;amp;&amp;amp; target.active.toString() == 'false'){
		ignore = true;
	}

})(source, map, log, target);&lt;/LI-CODE&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>Thu, 08 Jun 2023 04:47:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582179#M495773</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T04:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582193#M495775</link>
      <description>&lt;P&gt;This is ignoring the records where 2 duplicate name is present . it is not even updating the active records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 05:04:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582193#M495775</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T05:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582201#M495778</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how can there be 2 names in target if you are marking coalesce on name field?&lt;/P&gt;
&lt;P&gt;it should not&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 05:03:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582201#M495778</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T05:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582216#M495780</link>
      <description>&lt;P&gt;There are duplicate records, one is active one is inactive, i want to only update active one.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 05:19:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582216#M495780</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T05:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582222#M495781</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then it should update only the active record as per the onBefore transform script&lt;/P&gt;
&lt;P&gt;Can you share your field maps?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 05:22:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582222#M495781</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T05:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582258#M495784</link>
      <description>&lt;P&gt;field maps has only 2 fields , one is name is a string field and another field is internal/external(dropdown), so we are updating on the basis of name. i have used it earlier it updated all the records. but some of the active false record as well, so now i m trying to validate it before the insertion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 06:23:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582258#M495784</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T06:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582259#M495785</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as per onBefore transform script I shared it should update only the one which is active=true&lt;/P&gt;
&lt;P&gt;did you add logs and check what's the value of target.active in onBefore transform script&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 06:15:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582259#M495785</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T06:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582297#M495787</link>
      <description>&lt;PRE&gt;if(action == "update" &amp;amp;&amp;amp; target.active.toString() == 'false'){
		ignore = true;
	}&lt;/PRE&gt;&lt;P&gt;if i use this then it is not going inside the if condition, if i remove update part and only write target.active is true , then i am getting logs that target.active= false, where as i have 2 records present in&amp;nbsp; the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 06:53:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582297#M495787</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T06:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582303#M495788</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;did you check what's the action when you print in logs?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 06:56:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582303#M495788</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T06:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582322#M495791</link>
      <description>&lt;P&gt;it is showing insert, can we &lt;SPAN&gt;Use source script in the field map of NAME field?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:12:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582322#M495791</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T07:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582326#M495792</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;since it's showing insert then the name coming from import set is not an exact match&lt;/P&gt;
&lt;P&gt;If it would have been an exact match and since you have marked it as Coalesce it should find and set action as update&lt;/P&gt;
&lt;P&gt;please check the name is exact, no leading or trailing space in the import set field&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:16:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582326#M495792</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T07:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582334#M495793</link>
      <description>&lt;P&gt;i don't think so there is something like that, i am also getting warning as "&lt;SPAN&gt;More than one target records exists for target table cmdb_ci_business_app with query name=Salesforce&lt;/SPAN&gt;&amp;nbsp;"&lt;/P&gt;&lt;P&gt;earlier also i have used the same to bulk uplaod only few records didn't get updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:28:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582334#M495793</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T07:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582341#M495795</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if import set field is having exact same name as in target table then it should consider it as Update and not insert.&lt;/P&gt;
&lt;P&gt;Definitely some issue with the import set data. please debug it&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:29:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582341#M495795</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T07:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582378#M495799</link>
      <description>&lt;P&gt;Okay, now i am getting&amp;nbsp;&lt;SPAN&gt;false and action as update. but still isn't updating active one.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 08:04:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582378#M495799</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T08:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582385#M495800</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if it's coming inside the IF then that row should be ignored&lt;/P&gt;
&lt;P&gt;I hope you have created this script in onBefore transform script&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 08:08:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582385#M495800</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T08:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582391#M495801</link>
      <description>&lt;P&gt;yes, it is a onbefore one. yeah but the active one should be updated right?&lt;/P&gt;&lt;P&gt;it also shows target as empty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 08:52:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582391#M495801</guid>
      <dc:creator>Priya75</dc:creator>
      <dc:date>2023-06-08T08:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to update records in target table using transform map</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582451#M495807</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/192779"&gt;@Priya75&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sorry to say.&lt;/P&gt;
&lt;P&gt;It's very difficult to understand without the screenshots.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 09:18:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-update-records-in-target-table-using-transform-map/m-p/2582451#M495807</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-08T09:18:37Z</dc:date>
    </item>
  </channel>
</rss>

