<?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: Attribute Rule - Generate ID - Establishing Width in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027109#M37445</link>
    <description>&lt;P&gt;Haha, I didn't even think of the Text() function...&lt;/P&gt;&lt;P&gt;Disregard the above, use this instead:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;return "ADA-" + Text(NextSequenceValue("ADA"), "0000000")&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 16 Feb 2021 09:13:15 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2021-02-16T09:13:15Z</dc:date>
    <item>
      <title>Attribute Rule - Generate ID - Establishing Width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1026988#M37423</link>
      <description>&lt;P&gt;In Desktop's old Attribute Assistant, you could create a generate ID rule that could keep a consistent width to the integer portion of the ID.&amp;nbsp; So you could have a width of 7 and if the sequence was only 3 numbers, it would add 4 zeros to the left.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to&amp;nbsp; migrate a client from Attribute Assistant to Attribute Rules in Pro and I cannot find a way to accomplish this same functionality.&amp;nbsp; In the screenshot you can see how their IDs generated in ArcMap/Attribute-Assistant vs. how I can get them to generate in Pro using the following:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return "ADA-" + NextSequenceValue ("ADA")&lt;/P&gt;&lt;P&gt;where I've named the generated sequence "ADA"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HeidiHarris_0-1613426795346.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6073i89CE2F82ED309BD7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HeidiHarris_0-1613426795346.png" alt="HeidiHarris_0-1613426795346.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What arcade can I add in to that expression to maintain that forced width?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 22:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1026988#M37423</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-15T22:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Generate ID - Establishing Width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027034#M37429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous User&amp;nbsp;,&lt;/P&gt;&lt;P&gt;In ArcGIS Pro, click on the feature class layer you want to add attribute rules to in TOC and then click Data tab &amp;gt; Attribute Rules in Design.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MehdiPira1_0-1613439763133.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6092i70B9348DCDF19E3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MehdiPira1_0-1613439763133.png" alt="MehdiPira1_0-1613439763133.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In Attribute Roles windows you can add a Calculation Rule in Arcade like:&lt;/P&gt;&lt;P&gt;concatenate('ADA-000',$feature.&lt;SPAN&gt;&amp;lt;your fc field&amp;gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MehdiPira1_1-1613440031339.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6093i5441B71B986E8314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MehdiPira1_1-1613440031339.png" alt="MehdiPira1_1-1613440031339.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope that helps.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Mehdi&lt;/P&gt;&lt;P&gt;======================================================================&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please give a like if helpful and Accept as Solution if it's answered your query.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 01:49:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027034#M37429</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-02-16T01:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Generate ID - Establishing Width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027042#M37432</link>
      <description>Hi! Unfortunately that won’t quite work as we need the integer length to stay at 7 regardless of if the next sequence value is three (999) or four (1000) integers lonv&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Feb 2021 02:36:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027042#M37432</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-16T02:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Generate ID - Establishing Width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027062#M37441</link>
      <description>&lt;P&gt;@Anonymous User&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Then you need to use something similar to this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var ADA_id = split($feature.&amp;lt;your ADA field&amp;gt;, "-")[1]
If (Count(ADA_id ) == 4) {
   return concatenate('ADA-000',ADA_id)
}

else {
   If (Count(ADA_id ) == 3) {
      return concatenate('ADA-0000',ADA_id)
 } 
   else {

      return ADA_id

 }}&lt;/LI-CODE&gt;&lt;P&gt;======================================================================&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please give a like if helpful and Accept as Solution if it's answered your query.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 03:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027062#M37441</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-02-16T03:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Generate ID - Establishing Width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027108#M37444</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// next sequence value as string
var ada = "" + NextSequenceValue("ADA")

// there doesn't seem to be a while loop in Arcade,
// but we can fake one with a for loop...
for(var i = 0; i &amp;lt; 100; i++) {
  if(Count(ada) &amp;gt;= 7) {
    break
  }
  ada = "0" + ada
}

return "ADA-" + ada&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 09:06:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027108#M37444</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-02-16T09:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Generate ID - Establishing Width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027109#M37445</link>
      <description>&lt;P&gt;Haha, I didn't even think of the Text() function...&lt;/P&gt;&lt;P&gt;Disregard the above, use this instead:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;return "ADA-" + Text(NextSequenceValue("ADA"), "0000000")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Feb 2021 09:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027109#M37445</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-02-16T09:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Generate ID - Establishing Width</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027946#M37557</link>
      <description>&lt;P&gt;This worked perfectly!&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 03:53:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-generate-id-establishing-width/m-p/1027946#M37557</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-18T03:53:37Z</dc:date>
    </item>
  </channel>
</rss>

