<?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>topic Populate new field ID based on conditions from other fields in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/populate-new-field-id-based-on-conditions-from/m-p/108147#M3713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to populate a field using unique identification based on two existing fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Background: I ran the Density-Based Clustering tool on a set of points. The output creates a new field called 'Cluster ID' which groups clusters sequentially. If the input points are not a cluster they are assigned "-1". I created a new field called 'UOID' which copies the field from the 'Cluster ID' unless "-1", in that case it copies the field from the 'Source ID'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem: There are instances where both fields will be copied to the new field 'UOID' (for instance the number 1). Is there a python script that will allow me to populate the new field 'UOID' adding unique identification to distinguish which fields were copied?&amp;nbsp;For instance can i put a "C" in front of the copied fields from the 'Cluster ID' field and a "S" in front of the 'Source ID'? Take a look at my data. Long story short i need a way to distinguish which fields were copied using unique identification.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="458836" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/458836_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Sep 2019 20:51:38 GMT</pubDate>
    <dc:creator>nonipaulette</dc:creator>
    <dc:date>2019-09-05T20:51:38Z</dc:date>
    <item>
      <title>Populate new field ID based on conditions from other fields</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/populate-new-field-id-based-on-conditions-from/m-p/108147#M3713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to populate a field using unique identification based on two existing fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Background: I ran the Density-Based Clustering tool on a set of points. The output creates a new field called 'Cluster ID' which groups clusters sequentially. If the input points are not a cluster they are assigned "-1". I created a new field called 'UOID' which copies the field from the 'Cluster ID' unless "-1", in that case it copies the field from the 'Source ID'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem: There are instances where both fields will be copied to the new field 'UOID' (for instance the number 1). Is there a python script that will allow me to populate the new field 'UOID' adding unique identification to distinguish which fields were copied?&amp;nbsp;For instance can i put a "C" in front of the copied fields from the 'Cluster ID' field and a "S" in front of the 'Source ID'? Take a look at my data. Long story short i need a way to distinguish which fields were copied using unique identification.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="458836" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/458836_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2019 20:51:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/populate-new-field-id-based-on-conditions-from/m-p/108147#M3713</guid>
      <dc:creator>nonipaulette</dc:creator>
      <dc:date>2019-09-05T20:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Populate new field ID based on conditions from other fields</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/populate-new-field-id-based-on-conditions-from/m-p/108148#M3714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/371973" target="_blank"&gt;Noni&lt;/A&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using field calculator create a code block such as the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;uio&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cluster&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; source&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; cluster &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C%s'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt;cluster
  &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'S%s'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt;source‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The %s is replaced with the cluster or source value C1, S10, etc. &amp;nbsp;Make sure the field you are placing the return into is Text and not Numeric. &amp;nbsp;You would call the function using the field names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;uio(!cluster!, !source!)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:31:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/populate-new-field-id-based-on-conditions-from/m-p/108148#M3714</guid>
      <dc:creator>LanceCole</dc:creator>
      <dc:date>2021-12-11T06:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Populate new field ID based on conditions from other fields</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/populate-new-field-id-based-on-conditions-from/m-p/108149#M3715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked perfectly Lance. Now I can copy the appropriate fields, while ensuring they are uniquely identifiable. THanks alot!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 21:40:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/populate-new-field-id-based-on-conditions-from/m-p/108149#M3715</guid>
      <dc:creator>nonipaulette</dc:creator>
      <dc:date>2019-09-12T21:40:33Z</dc:date>
    </item>
  </channel>
</rss>

