<?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: Populating 'createddate2' field with 'created_date' field. in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552332#M9819</link>
    <description>&lt;P&gt;Just like globalid, created_date does not get populated until the record is added to the actual service, which does not occur until you save - and if offline not until you sync. The expressions run before the save that is why its empty.&amp;nbsp; &amp;nbsp;As stated using now() would be the way to go.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2024 13:39:42 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2024-10-25T13:39:42Z</dc:date>
    <item>
      <title>Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552081#M9812</link>
      <description>&lt;P&gt;Hello GIS friends,&lt;/P&gt;&lt;P&gt;I have created a field called 'createddate2' and I'm trying to populate that field in Field Maps Designer using the forms option so when people create features using Field Map or web Web Map the 'created_date' value is dynamically added to the new field (createddate2) field.&lt;/P&gt;&lt;P&gt;I have used this '&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;created_date' expression in the arcade editor form but it does not populate when the feature gets created. It only populates if I go back to the feature to edit and click update.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your input will be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Abi&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is what I'm using:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbiDhakal_2-1729802053496.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118070i6C19BEAA97955C9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="AbiDhakal_2-1729802053496.png" alt="AbiDhakal_2-1729802053496.png" /&gt;&lt;/span&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 20:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552081#M9812</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2024-10-24T20:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552149#M9815</link>
      <description>&lt;P&gt;I would suggest using the "now()" function instead of accessing that attribute directly.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 23:25:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552149#M9815</guid>
      <dc:creator>ClayDonaldsonSWCA</dc:creator>
      <dc:date>2024-10-24T23:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552211#M9818</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Editor Tracking will systematically track who and when features were last created or edited:&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/arcgis-online/manage-data/manage-editing-hfl.htm#ESRI_SECTION2_60D988F67914496C8D5DC454DF25080D" target="_blank"&gt;https://doc.arcgis.com/en/arcgis-online/manage-data/manage-editing-hfl.htm#ESRI_SECTION2_60D988F67914496C8D5DC454DF25080D&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want to manually populate a created date field, you will need to create a field and calculate it using the Form. I'm a bit confused with how many fields you have but to help break down some key concepts:&lt;/P&gt;&lt;P&gt;Calculating &lt;EM&gt;$feature.created_date&lt;/EM&gt; will return the value from the field 'created_date'. I don't believe we have a second field here and there is just some confusion.&lt;/P&gt;&lt;P&gt;As Clay said, using now() or today() would be better to calculate a date. However, if you are editing the feature later on, the created date value will get overwritten by the calculation again.&lt;/P&gt;&lt;P&gt;So you could use the below Arcade expression. It has some additional logic to only calculate when the feature is created (INSERT). It will calculate the date and time if the user uses the form (i.e. in Map Viewer or Field Maps). It won't work if they load in the data some other way, such as ArcGIS Pro, or a map that does not have the form.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// determine our edit mode ("INSERT", "UPDATE", or "DELETE")
var mode = $editcontext.editType

// If mode is insert, return the current time. Can use today() for date only.
if(mode == "INSERT"){
    return now()
}else{
    // return existing value of field we are editing
    return $originalfeature.createddate2
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Oct 2024 06:17:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552211#M9818</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-10-25T06:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552332#M9819</link>
      <description>&lt;P&gt;Just like globalid, created_date does not get populated until the record is added to the actual service, which does not occur until you save - and if offline not until you sync. The expressions run before the save that is why its empty.&amp;nbsp; &amp;nbsp;As stated using now() would be the way to go.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 13:39:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552332#M9819</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-10-25T13:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552355#M9820</link>
      <description>&lt;P&gt;Thank you for your code. it works perfectly!&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/412943"&gt;@ChristopherCounsell&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any suggestions for Pro or other tools?&lt;/P&gt;&lt;P&gt;I would like to share some background information. This is a copy collaboration that allows users in ArcGIS Online to edit the service. However, when the service syncs back to the Portal, the editor tracking values in the created_user field from ArcGIS Online are overwritten with the Portal administrator's username. With your help, I can now retain the created_date value.&lt;/P&gt;&lt;P&gt;It would be great if Esri could not only maintain the Portal administrator's username but also preserve the editor tracking values from collaboration partners.&lt;/P&gt;&lt;P&gt;How would you handle records for collaboration partners?&lt;/P&gt;&lt;P&gt;Your insights, ideas, and assistance are greatly appreciated.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Abi&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 14:11:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552355#M9820</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2024-10-25T14:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552357#M9821</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/261163"&gt;@ClayDonaldsonSWCA&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your input. How would you use now()? Where would I put it?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 14:15:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552357#M9821</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2024-10-25T14:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552359#M9822</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is saving did not populate it. I would have to go back and edit and update to populate it. Thanks to &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/412943"&gt;@ChristopherCounsell&lt;/a&gt;&amp;nbsp;. His expression worked.&lt;/P&gt;&lt;P&gt;How would you write a complete expression with now()?&lt;/P&gt;&lt;P&gt;Thank you,&lt;BR /&gt;Abi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 14:19:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552359#M9822</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2024-10-25T14:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Populating 'createddate2' field with 'created_date' field.</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552387#M9823</link>
      <description>&lt;P&gt;The code he posted looks pretty good to me.&amp;nbsp; I would test it with Copy from existing features though too as we saw that can work differently.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 15:18:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/populating-createddate2-field-with-created-date/m-p/1552387#M9823</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-10-25T15:18:56Z</dc:date>
    </item>
  </channel>
</rss>

