<?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 ModelBuilder - automatic rename attributes in table in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1038995#M2157</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another question for today - automatic renaming values in ModelBuilder?&lt;/P&gt;&lt;P&gt;My table have attributes looks like this:&lt;/P&gt;&lt;P&gt;FID&amp;nbsp; &amp;nbsp; &amp;nbsp; CODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CODE2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;...........and so on.&lt;/P&gt;&lt;P&gt;And my goal is - that column CODE2 will be automatically calculated.&lt;/P&gt;&lt;P&gt;So, there are two polygons with CODE 1001 but CODE2 is different for each of these.&lt;/P&gt;&lt;P&gt;FID&amp;nbsp; &amp;nbsp; &amp;nbsp; CODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CODE2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;Is there some possibility to do this?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Mar 2021 15:20:32 GMT</pubDate>
    <dc:creator>StanislavaV</dc:creator>
    <dc:date>2021-03-20T15:20:32Z</dc:date>
    <item>
      <title>ModelBuilder - automatic rename attributes in table</title>
      <link>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1038995#M2157</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another question for today - automatic renaming values in ModelBuilder?&lt;/P&gt;&lt;P&gt;My table have attributes looks like this:&lt;/P&gt;&lt;P&gt;FID&amp;nbsp; &amp;nbsp; &amp;nbsp; CODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CODE2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;...........and so on.&lt;/P&gt;&lt;P&gt;And my goal is - that column CODE2 will be automatically calculated.&lt;/P&gt;&lt;P&gt;So, there are two polygons with CODE 1001 but CODE2 is different for each of these.&lt;/P&gt;&lt;P&gt;FID&amp;nbsp; &amp;nbsp; &amp;nbsp; CODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CODE2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;Is there some possibility to do this?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Mar 2021 15:20:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1038995#M2157</guid>
      <dc:creator>StanislavaV</dc:creator>
      <dc:date>2021-03-20T15:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder - automatic rename attributes in table</title>
      <link>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039025#M2160</link>
      <description>&lt;P&gt;I would suggest a Python field calculation.&amp;nbsp; I've never come across anything to automatically do something like that.&lt;/P&gt;&lt;P&gt;If your data is ordered by FID, will it always be ordered by CODE? i.e. will it always follow the logical structure you provided in the example?&lt;/P&gt;&lt;P&gt;FID&amp;nbsp; &amp;nbsp; &amp;nbsp; CODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CODE2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not, is the order of assignment of auto-incremented values important? i.e. would you be happy if the lowest FID had the highest increment or that it was random?&lt;/P&gt;&lt;P&gt;FID&amp;nbsp; &amp;nbsp; &amp;nbsp; CODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CODE2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;</description>
      <pubDate>Sat, 20 Mar 2021 18:21:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039025#M2160</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-20T18:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder - automatic rename attributes in table</title>
      <link>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039029#M2161</link>
      <description>&lt;P&gt;Yes, it does not really matter. That CODE2 is just needed for differentiate polygons with label CODE.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Mar 2021 18:33:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039029#M2161</guid>
      <dc:creator>StanislavaV</dc:creator>
      <dc:date>2021-03-20T18:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder - automatic rename attributes in table</title>
      <link>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039032#M2163</link>
      <description>&lt;P&gt;OK, so run a field calculator ensuring that Python is chosen as the expression type.&lt;/P&gt;&lt;P&gt;pre-logic script code/ Code block:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;CODE_dict = {}
def auto_increment(field):
    global CODE_dict
    if field in CODE_dict.keys():
        CODE_dict[field] += 1
        return CODE_dict[field]
    else:
        CODE_dict[field] = 1
        return 1
        &lt;/LI-CODE&gt;&lt;P&gt;to run it using that function:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;auto_increment(!CODE!)&lt;/LI-CODE&gt;&lt;P&gt;The code block creates a global dictionary to store a key of the CODE against an increment.&amp;nbsp; If no key exists in the dictionary, the key(CODE) is added to it, with a value of 1.&amp;nbsp; This is also then returned by the function.&lt;/P&gt;&lt;P&gt;If the key(CODE) does exist in the dictionary, the value is then incremented by 1, and that value returned.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Mar 2021 18:56:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039032#M2163</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-20T18:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder - automatic rename attributes in table</title>
      <link>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039035#M2164</link>
      <description>&lt;P&gt;yay!&lt;/P&gt;&lt;P&gt;that´s exactly what I was looking for the whole day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Mar 2021 19:58:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/modelbuilder-automatic-rename-attributes-in-table/m-p/1039035#M2164</guid>
      <dc:creator>StanislavaV</dc:creator>
      <dc:date>2021-03-20T19:58:36Z</dc:date>
    </item>
  </channel>
</rss>

