<?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 Re: Field Map Not Working Properly in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/field-map-not-working-properly/m-p/3318244#M1215083</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/283693"&gt;@Ariomar de Deus&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need more information of the transform map you configured to help you out on this issue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is&amp;nbsp;cd_sub_item a what type of field in x_bdb_5wa_000004_teste table and what value is coming from source.u_cod_subitem?&lt;/P&gt;
&lt;P&gt;Also replace&amp;nbsp;source.u_cod_subitem with&amp;nbsp;source.u_cod_subitem.toString() and check.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(function transformEntry(source) {
    if (source.u_cod_subitem) {
        var a1 = new GlideRecord("x_bdb_5wa_000004_teste");
        a1.addQuery("cd_sub_item", source.u_cod_subitem.toString());
        a1.query();
        if (a1.next()) {
            return a1.sys_id.toString();
        }
    }
    return "";
})(source);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jul 2025 11:41:11 GMT</pubDate>
    <dc:creator>Voona Rohila</dc:creator>
    <dc:date>2025-07-11T11:41:11Z</dc:date>
    <item>
      <title>Field Map Not Working Properly</title>
      <link>https://www.servicenow.com/community/developer-forum/field-map-not-working-properly/m-p/3318214#M1215076</link>
      <description>&lt;P&gt;Hey guys, I'm creating a field map with the code below, but there are a few issues that are causing the code to not work properly.&lt;/P&gt;&lt;P&gt;When I check Coalesce, all records are skipped and this error message appears:&lt;BR /&gt;"Unable to resolve target record, coalesce values ​​not present:"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other issue is that when I uncheck Coalesce, it inserts all records but doesn't insert existing records, creating new, empty records with new sys IDs.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(function transformEntry(source) {
    if (source.u_cod_subitem) {
        var a1 = new GlideRecord("x_bdb_5wa_000004_teste");
        a1.addQuery("cd_sub_item", source.u_cod_subitem);
        a1.query();
        if (a1.next()) {
            return a1.sys_id.toString();
        }
    }
    return "";
})(source);&lt;/LI-CODE&gt;&lt;P&gt;Could someone help me find a solution for this?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2025 11:11:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/field-map-not-working-properly/m-p/3318214#M1215076</guid>
      <dc:creator>Ariomar de Deus</dc:creator>
      <dc:date>2025-07-11T11:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Field Map Not Working Properly</title>
      <link>https://www.servicenow.com/community/developer-forum/field-map-not-working-properly/m-p/3318244#M1215083</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/283693"&gt;@Ariomar de Deus&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need more information of the transform map you configured to help you out on this issue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is&amp;nbsp;cd_sub_item a what type of field in x_bdb_5wa_000004_teste table and what value is coming from source.u_cod_subitem?&lt;/P&gt;
&lt;P&gt;Also replace&amp;nbsp;source.u_cod_subitem with&amp;nbsp;source.u_cod_subitem.toString() and check.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(function transformEntry(source) {
    if (source.u_cod_subitem) {
        var a1 = new GlideRecord("x_bdb_5wa_000004_teste");
        a1.addQuery("cd_sub_item", source.u_cod_subitem.toString());
        a1.query();
        if (a1.next()) {
            return a1.sys_id.toString();
        }
    }
    return "";
})(source);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2025 11:41:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/field-map-not-working-properly/m-p/3318244#M1215083</guid>
      <dc:creator>Voona Rohila</dc:creator>
      <dc:date>2025-07-11T11:41:11Z</dc:date>
    </item>
  </channel>
</rss>

