<?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 Arcade Calculation for Creating ID when add new record getting cleared out in Edit mode in Experience Builder in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-calculation-for-creating-id-when-add-new/m-p/1293792#M52465</link>
    <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;I am using the below code to generate the year as part of an ID that I am creating in an AGO Map Viewer Form and pulling into Experience Builder. The ID has the following structure: {PR_PROJYEAR} - SW{PR_PROJNUM}. The current year should be generated using the below code, and Project Number created using a separate script, and they they are concatenated to create the ID. This is functioning in Map Viewer as expected when I add a new feature, and is maintained when I edit a feature. In Experience Builder, the ID is generated as expected when I add a new feature, but when I edit a feature, the Project Year, Project Number, and ID&amp;nbsp; are all wiped out. Is this a bug? Or can you tell me what I am doing wrong in the below code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//Generates Project Year based upon the year the nomination is added

// Define the edit context so the value is only calculated when the feature is created 
if ($editContext.editType == "INSERT") { 

//returns the current year
var timestam = Today()
var currentyear = Year(timestam)
 
return currentyear;

//keeps the current value if record is being updated only

} else if ($editContext.editType == "UPDATE") {

return $feature.PR_PROJYEAR

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 May 2023 16:09:35 GMT</pubDate>
    <dc:creator>LJackson29</dc:creator>
    <dc:date>2023-05-28T16:09:35Z</dc:date>
    <item>
      <title>Arcade Calculation for Creating ID when add new record getting cleared out in Edit mode in Experience Builder</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-calculation-for-creating-id-when-add-new/m-p/1293792#M52465</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;I am using the below code to generate the year as part of an ID that I am creating in an AGO Map Viewer Form and pulling into Experience Builder. The ID has the following structure: {PR_PROJYEAR} - SW{PR_PROJNUM}. The current year should be generated using the below code, and Project Number created using a separate script, and they they are concatenated to create the ID. This is functioning in Map Viewer as expected when I add a new feature, and is maintained when I edit a feature. In Experience Builder, the ID is generated as expected when I add a new feature, but when I edit a feature, the Project Year, Project Number, and ID&amp;nbsp; are all wiped out. Is this a bug? Or can you tell me what I am doing wrong in the below code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//Generates Project Year based upon the year the nomination is added

// Define the edit context so the value is only calculated when the feature is created 
if ($editContext.editType == "INSERT") { 

//returns the current year
var timestam = Today()
var currentyear = Year(timestam)
 
return currentyear;

//keeps the current value if record is being updated only

} else if ($editContext.editType == "UPDATE") {

return $feature.PR_PROJYEAR

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 16:09:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-calculation-for-creating-id-when-add-new/m-p/1293792#M52465</guid>
      <dc:creator>LJackson29</dc:creator>
      <dc:date>2023-05-28T16:09:35Z</dc:date>
    </item>
  </channel>
</rss>

