<?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: Arcade &amp;amp; Calculate field with text and incrementing number with a starting number and an interval in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126500#M49076</link>
    <description>&lt;P&gt;I'd be really surprised if Arcade has a short shelf life.&amp;nbsp; I'm sold on attribute rules and without Arcade, they don't happen.&lt;/P&gt;&lt;P&gt;ArcMap and ArcCatalog have one foot in the grave, there's just no denying it.&lt;/P&gt;&lt;P&gt;By the end of this week, all this stuff will be in my rear-view mirror, but I've had a ton of fun with Unix Scripts, AML, PERL, VB, VBA, Python, and Arcade over the years in various flavors of ESRI-Arc* products. You may notice I left out Avenue.&amp;nbsp; IMHO that along with ArcView was a mistake and luckily &lt;STRONG&gt;&lt;EM&gt;did&lt;/EM&gt;&lt;/STRONG&gt; have a short shelf life. (And somehow I never spent much time or energy with it...)&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 23:06:56 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2021-12-15T23:06:56Z</dc:date>
    <item>
      <title>Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126220#M49047</link>
      <description>&lt;P&gt;I have Python calculate field expression (.cal file) that does this but I'm trying to migrate it to Arcade.&lt;/P&gt;&lt;P&gt;It's not working. The number part is not incrementing and I guess it has to do with me not being able of defining 'rec' as a global variable.&lt;/P&gt;&lt;P&gt;This is the Python expression. How do I migrate the 'global rec' line to Arcade?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Params
val_counter = 2498
prefix = 'PP_'
interval = 1
# -------------------------------------------
# Function
rec=0
def SetIDcode(val_counter, prefix, interval):
  global rec
  if (rec == 0):
    rec = val_counter
  else:
    rec += interval
  return (prefix+ str(rec))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126220#M49047</guid>
      <dc:creator>AGP</dc:creator>
      <dc:date>2021-12-15T12:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126237#M49048</link>
      <description>&lt;P&gt;Here's the equivalent of your function in Arcade:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var rec = 0
function SetIDcode(val_counter, prefix, interval){
    if (rec == 0){
        rec = val_counter
    } else {
        rec += interval
    }
    return prefix + rec
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's me testing it with the sample parameters you gave:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1639575923687.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29754i82F33C64522DFB7A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1639575923687.png" alt="jcarlson_0-1639575923687.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can you explain a bit more about how you use this, though? Is the &lt;STRONG&gt;rec&lt;/STRONG&gt; variable always going to be 0, or are there other parts of the expression that alter it?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 13:49:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126237#M49048</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-15T13:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126244#M49049</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;rec&lt;/STRONG&gt; variable is 0 for the first feature, so the returned valued is p&lt;STRONG&gt;refix + val_counter&lt;/STRONG&gt; (PP_2498).&lt;/P&gt;&lt;P&gt;But then the &lt;STRONG&gt;rec&lt;/STRONG&gt; varaible should get the value in &lt;STRONG&gt;val_counter&lt;/STRONG&gt; for the second feature returning &lt;STRONG&gt;prefix + val_counter + interval&lt;/STRONG&gt; (PP_2499) and incrementing by &lt;STRONG&gt;interval&lt;/STRONG&gt; for each next feature (PP_2500, 2501,...).&lt;/P&gt;&lt;P&gt;Your function (mine was like yours) returns PP_2498 for every feature.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 14:09:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126244#M49049</guid>
      <dc:creator>AGP</dc:creator>
      <dc:date>2021-12-15T14:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126248#M49050</link>
      <description>&lt;P&gt;What if you use an attribute rule that grabs a the next value from a geodatabase sequence?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 14:16:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126248#M49050</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-15T14:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126257#M49051</link>
      <description>&lt;P&gt;I see. That will only work for an iterative loop, not in the Field Calculate profile. When writing a field calculation in Arcade, you have to imagine that you're already &lt;EM&gt;in &lt;/EM&gt;the loop, as the expression will be evaluated for every feature.&lt;/P&gt;&lt;P&gt;In Arcade, we &lt;EM&gt;can &lt;/EM&gt;access and work with the other values in the layer, so you've got some options. Is the code stored only as a string, or is there some way to access the numeric val_counter without the prefix?&lt;/P&gt;&lt;P&gt;Also, what values are in this field right now? Are they null? Does the &lt;STRONG&gt;val_counter&lt;/STRONG&gt; correspond to the number of records in the layer?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 14:37:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126257#M49051</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-15T14:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126263#M49052</link>
      <description>&lt;P&gt;The user inputs the &lt;STRONG&gt;val_counter&lt;/STRONG&gt; value according to their needs, as well as the &lt;STRONG&gt;prefix&lt;/STRONG&gt; and &lt;STRONG&gt;interval&lt;/STRONG&gt; values.&lt;/P&gt;&lt;P&gt;I guess &lt;STRONG&gt;interval&lt;/STRONG&gt; will always be 1 but they are given the option to decide.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 15:03:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126263#M49052</guid>
      <dc:creator>AGP</dc:creator>
      <dc:date>2021-12-15T15:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126268#M49055</link>
      <description>&lt;P&gt;Are you sure the Arcade field calculator is the right option for this? You may be better off my making your python script into a GP tool.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 15:13:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126268#M49055</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-15T15:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126275#M49057</link>
      <description>&lt;P&gt;I thought of the possibility of using Batch calculation rules so users would execute the rules whenever they need it. We should just publish our feature services with the validation capability enabled and create a database sequence (if the db admin approves).&lt;/P&gt;&lt;P&gt;The problem here is that the user decides the layer and field they will populate so attribute rules are not an option. Using a calculate field expression is more convenient here but we wanted to use Arcade instead of Python.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 15:35:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126275#M49057</guid>
      <dc:creator>AGP</dc:creator>
      <dc:date>2021-12-15T15:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126281#M49058</link>
      <description>&lt;P&gt;The python field calculator is a good option actually. We wanted to use the existing tools in ArcGIS Pro as much as possible and also try to use Arcade as much as possible, but I see python is still the way to go for some processing. We are still evaluating all the geoprocessing needs of our users and maybe will consider using a custom python toolbox. We'll see.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 16:04:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126281#M49058</guid>
      <dc:creator>AGP</dc:creator>
      <dc:date>2021-12-15T16:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126293#M49059</link>
      <description>&lt;P&gt;Could you build this into a model, perhaps? Then you could still be using a field calculation with the expression baked in, but expose the layer and field as user-specified parameters.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 16:36:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126293#M49059</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-15T16:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126302#M49062</link>
      <description>&lt;P&gt;Using Arcade when you don't have to seems like jumping through extra hoops to me. I have not seen any upside to it yet.&lt;/P&gt;&lt;P&gt;I am betting Arcade will go away before I need to learn it.&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 16:48:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126302#M49062</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2021-12-15T16:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126308#M49064</link>
      <description>&lt;P&gt;If you're working on desktop, you probably don't have to learn it, but a lot of the web stuff is being built around it. I use Arcade in Pro when I know the layer / expressions / etc. will need to transfer 1:1 to a web map or field app.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 16:52:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126308#M49064</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-15T16:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126500#M49076</link>
      <description>&lt;P&gt;I'd be really surprised if Arcade has a short shelf life.&amp;nbsp; I'm sold on attribute rules and without Arcade, they don't happen.&lt;/P&gt;&lt;P&gt;ArcMap and ArcCatalog have one foot in the grave, there's just no denying it.&lt;/P&gt;&lt;P&gt;By the end of this week, all this stuff will be in my rear-view mirror, but I've had a ton of fun with Unix Scripts, AML, PERL, VB, VBA, Python, and Arcade over the years in various flavors of ESRI-Arc* products. You may notice I left out Avenue.&amp;nbsp; IMHO that along with ArcView was a mistake and luckily &lt;STRONG&gt;&lt;EM&gt;did&lt;/EM&gt;&lt;/STRONG&gt; have a short shelf life. (And somehow I never spent much time or energy with it...)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 23:06:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126500#M49076</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-15T23:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126652#M49083</link>
      <description>&lt;P&gt;I know some folks who still maintain a "I'll wait this fad out" mentality about Python in ESRI products. You can probably imagine how that's going for them.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 13:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126652#M49083</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-16T13:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126913#M49107</link>
      <description>&lt;P&gt;Almost every GIS person I know tried Python a few years ago and now ignores it. So it seems to be going fine. I'm at the other extreme, so much so that they had to change my job description.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The good news about Arcade is that you can learn everything you need from it in about an hour. It's only a mistake if you think it's a programming language.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 20:38:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126913#M49107</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2021-12-16T20:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126914#M49108</link>
      <description>&lt;P&gt;Wait, was there someone at the top of this thread still waiting for an answer?&amp;nbsp; Now I feel I need to make amends for hijacking by actually answering the question. Where's Dan when we need him?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 20:41:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126914#M49108</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2021-12-16T20:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126917#M49109</link>
      <description>&lt;P&gt;lol. &lt;EM&gt;Summons &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Someone probably just needs a decent update cursor, but arcpy's outta my wheelhouse.&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 20:48:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126917#M49109</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-16T20:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126962#M49115</link>
      <description>&lt;P&gt;"Avenue"... now "Arcade"&amp;nbsp; .&lt;/P&gt;&lt;P&gt;I got burned once learning a proprietary language (google esri history) that you can't use elsewhere.&lt;/P&gt;&lt;P&gt;I will stick to Python (and other languages), .&amp;nbsp; Besides, python is even beating out the other curly bracket languages in terms of wide spread use.&amp;nbsp; If you have to do the cloudy map stuff, you may be stuck&amp;nbsp; but don't use it as a replacement for learning other languages that you can use outside of the "Arc"&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 22:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1126962#M49115</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-16T22:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1127027#M49125</link>
      <description>&lt;P&gt;You know, I'm actually quite curious to know more about what you do, if you don't mind elaborating. My own experience in "GIS" is rather narrow, being almost exclusively focused on "cloudy map stuff" and the systems they're built on. So, &lt;EM&gt;lots&lt;/EM&gt; of Python, js, SQL, and yes, Arcade. But I think there's always something valuable to learn from how other people work, especially when those processes are very different from my own.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 00:13:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1127027#M49125</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-17T00:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade &amp; Calculate field with text and incrementing number with a starting number and an interval</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1127031#M49129</link>
      <description>&lt;P&gt;Taught university GIS (30+ years), consulted on same in multiple fields (eg. engineering, data analysis, medical, general modelling)... programming since 1968... basically your typical Geographer ("Geography is what Geographers Do").&amp;nbsp; Now retired .... sort of retired ... that is &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 00:21:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-amp-calculate-field-with-text-and/m-p/1127031#M49129</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-17T00:21:30Z</dc:date>
    </item>
  </channel>
</rss>

