<?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 Re: Generate an auto populating unique ID field in ArcMap  in ArcGIS Collector Questions</title>
    <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37130#M827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using a enterprise database you can use&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-incrementing-id-field.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-incrementing-id-field.htm"&gt;Add Incrementing ID Field—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Shan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jul 2017 04:44:21 GMT</pubDate>
    <dc:creator>shan_sarkar</dc:creator>
    <dc:date>2017-07-10T04:44:21Z</dc:date>
    <item>
      <title>Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37125#M822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using ArcMap 10.5. I need to have a field where a unique ID is generated every time I add a point/polygon/feature. How would I go about doing this? I've tried some Python and VBA scripts seen on Geonet however they did not seem to work. Also, If I am able to get this working in ArcMap will that same functionality transfer over to the Collector App if I publish the layer to collect points?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 15:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37125#M822</guid>
      <dc:creator>JoelGuerra1</dc:creator>
      <dc:date>2017-07-07T15:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37126#M823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;A href="http://solutions.arcgis.com/shared/help/attribute-assistant/"&gt;attribute assistant&lt;/A&gt; can achieve this.&amp;nbsp; Take a look at the &lt;A href="http://solutions.arcgis.com/shared/help/attribute-assistant/documentation/methods-sequences-and-id/"&gt;Sequences and Id&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 16:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37126#M823</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2017-07-07T16:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37127#M824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is seems like your backend GDB is an enterprise and not file GDB?&amp;nbsp; Correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beyond saying you tried some stuff and it didn't work, it is helpful to reference what you have tried and what didn't work specifically.&amp;nbsp; For example, I tried (&lt;EM&gt;insert link&lt;/EM&gt;) and I get the following error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 17:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37127#M824</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-07-07T17:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37128#M825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd recommend a &lt;A href="http://wiki.gis.com/wiki/index.php/GlobalID"&gt;GLOBALID field&lt;/A&gt;, which is the&amp;nbsp;ideal primary key for related records. If you publish this dataset as an Esri-hosted Feature Service, the GlobalID values will be generated each time you create a new feature in Collector. You can &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-global-ids.htm"&gt;Add Global IDs&lt;/A&gt; in ArcCatalog or with geoprocessing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Micah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 18:16:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37128#M825</guid>
      <dc:creator>MicahBabinski</dc:creator>
      <dc:date>2017-07-07T18:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37129#M826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is a database question. I think it is better if you move this question to &lt;A href="https://community.esri.com/groups/geodatabase?sr=search&amp;amp;searchId=34a288dd-548f-47db-99f3-f218563cdd64&amp;amp;searchIndex=4"&gt;https://community.esri.com/groups/geodatabase?sr=search&amp;amp;searchId=34a288dd-548f-47db-99f3-f218563cdd64&amp;amp;searchIndex=4&lt;/A&gt;‌ .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 22:23:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37129#M826</guid>
      <dc:creator>AbdullahAnter</dc:creator>
      <dc:date>2017-07-07T22:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37130#M827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using a enterprise database you can use&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-incrementing-id-field.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-incrementing-id-field.htm"&gt;Add Incrementing ID Field—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Shan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 04:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37130#M827</guid>
      <dc:creator>shan_sarkar</dc:creator>
      <dc:date>2017-07-10T04:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37131#M828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Moved to &lt;A href="https://community.esri.com/community/gis/applications/collector-for-arcgis?sr=search&amp;amp;searchId=e36ff7d0-e005-4c11-993c-b505d448b058&amp;amp;searchIndex=0"&gt;https://community.esri.com/community/gis/applications/collector-for-arcgis?sr=search&amp;amp;searchId=e36ff7d0-e005-4c11-993c-b505d448b058&amp;amp;searchIndex=0&lt;/A&gt;‌.&amp;nbsp; Functionality that exists within ArcMap is not necessarily implemented in other software.&amp;nbsp; They would best able to answer your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 05:03:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37131#M828</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-07-10T05:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37132#M829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had this issue and went the following route:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the field that is the ID is a number field, create a view for creating the next ID in sequence in SQL Server such as:&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;SELECT&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MAX&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FieldName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; NEXT_ID
&lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; owner&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TABLENAME‍‍‍‍&lt;SPAN class="line-numbers-rows"&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;Then, in Model Builder, I created a model to assign the ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get Field Value: Using your view that you created: Field is NEXT_ID, Data Type is Long&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make a Feature Layer of the&amp;nbsp;feature class you are trying to update, then Select By Attribute as "FieldName IS NULL", then calculate "FieldName" with the "Value" from the next available ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate Field (Python 9.3):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Expression&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
autoIncrement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Code Block&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
rec&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; 
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;autoIncrement&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
 &lt;SPAN class="keyword token"&gt;global&lt;/SPAN&gt; rec 
 pStart &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt;Value&lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt;
 pInterval &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; 
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rec &lt;SPAN class="operator token"&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="punctuation token"&gt;:&lt;/SPAN&gt; 
 rec &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pStart 
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
 rec &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; pInterval 
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; rec‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;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;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/436571_model.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From here, you can import the Model Builder model into a Python script as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ImportToolbox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"C:\Path\To\Your\Toolbox\AutoID.tbx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"test"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ModelName_test&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&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;Make sure you add &lt;STRONG&gt;_test()&lt;/STRONG&gt; to the end of your model name and "test" at the end of your toolbox.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:26:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37132#M829</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2021-12-10T21:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37133#M830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this Brian. I will give it a try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2019 19:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/37133#M830</guid>
      <dc:creator>JoelGuerra1</dc:creator>
      <dc:date>2019-02-06T19:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generate an auto populating unique ID field in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/1204710#M13673</link>
      <description>&lt;P&gt;Were you able to get this to run in Python?&lt;BR /&gt;&lt;BR /&gt;I noticed&amp;nbsp; get Field Value&lt;SPAN&gt;&amp;nbsp;is intended for use in ModelBuilder and not in Python scripting&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 19:42:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-collector-questions/generate-an-auto-populating-unique-id-field-in/m-p/1204710#M13673</guid>
      <dc:creator>PatrL</dc:creator>
      <dc:date>2022-08-19T19:42:36Z</dc:date>
    </item>
  </channel>
</rss>

