<?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 Can an arcade attribute rule update a date field? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480277#M24101</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the &lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/"&gt;date functions&lt;/A&gt; in &lt;A href="https://developers.arcgis.com/arcade/"&gt;arcade&lt;/A&gt;&amp;nbsp;to calculate a date from data stored&amp;nbsp;within a barcode. All works well in sandbox, but applying the&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-attribute-rules.htm"&gt;attribute rule&lt;/A&gt;&amp;nbsp;to a date field causes the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 1.5pt 0in 1.5pt 7.5pt;"&gt;&lt;STRONG style=": ; color: blue; text-decoration: underline; font-size: 9.0pt;"&gt;ERROR 000358:&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; color: #e54724;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Invalid expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 1.5pt 0in 1.5pt 7.5pt;"&gt;&lt;SPAN style="font-size: 9.0pt; color: #e54724;"&gt;Failed to execute (AddAttributeRule).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return of the expression is a date variable. The rule applies successfully to a text field and triggers and functions as expected. The expression itself validates successfully within the &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/add-attribute-rule.htm"&gt;add attribute rule&lt;/A&gt;&amp;nbsp;tool. The error only appears after attempting to run the tool against a date field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simplified expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;OL&gt;&lt;LI&gt;var inputdate = date(2000,01,01)&lt;/LI&gt;&lt;LI&gt;return inputdate&lt;/LI&gt;&lt;/OL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attempting to apply this as an attribute rule to a date field will render the error mentioned above. Any ideas on how I could&amp;nbsp;apply a like expression to a date field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Mar 2018 19:11:35 GMT</pubDate>
    <dc:creator>MatthewBaber</dc:creator>
    <dc:date>2018-03-01T19:11:35Z</dc:date>
    <item>
      <title>Can an arcade attribute rule update a date field?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480277#M24101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the &lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/"&gt;date functions&lt;/A&gt; in &lt;A href="https://developers.arcgis.com/arcade/"&gt;arcade&lt;/A&gt;&amp;nbsp;to calculate a date from data stored&amp;nbsp;within a barcode. All works well in sandbox, but applying the&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-attribute-rules.htm"&gt;attribute rule&lt;/A&gt;&amp;nbsp;to a date field causes the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 1.5pt 0in 1.5pt 7.5pt;"&gt;&lt;STRONG style=": ; color: blue; text-decoration: underline; font-size: 9.0pt;"&gt;ERROR 000358:&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; color: #e54724;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Invalid expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 1.5pt 0in 1.5pt 7.5pt;"&gt;&lt;SPAN style="font-size: 9.0pt; color: #e54724;"&gt;Failed to execute (AddAttributeRule).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return of the expression is a date variable. The rule applies successfully to a text field and triggers and functions as expected. The expression itself validates successfully within the &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/add-attribute-rule.htm"&gt;add attribute rule&lt;/A&gt;&amp;nbsp;tool. The error only appears after attempting to run the tool against a date field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simplified expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;OL&gt;&lt;LI&gt;var inputdate = date(2000,01,01)&lt;/LI&gt;&lt;LI&gt;return inputdate&lt;/LI&gt;&lt;/OL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attempting to apply this as an attribute rule to a date field will render the error mentioned above. Any ideas on how I could&amp;nbsp;apply a like expression to a date field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2018 19:11:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480277#M24101</guid>
      <dc:creator>MatthewBaber</dc:creator>
      <dc:date>2018-03-01T19:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can an arcade attribute rule update a date field?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480278#M24102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could this be related to "&lt;EM style="background-color: #ffffff; border: 0px;"&gt;BUG-0001&lt;/EM&gt;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;12055 -&amp;nbsp;The Arcade expression to format date in attribute rules doesn't return the correct year results&lt;/EM&gt;"? Although in this case it's not about formatting the date, but about storing the date providing a date object with Arcade.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CC&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/45316"&gt;Kory Kramer&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A href="https://community.esri.com/people/Supriya_Khadke-esristaff"&gt;Supriya_Khadke-esristaff&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 02:48:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480278#M24102</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-02T02:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can an arcade attribute rule update a date field?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480279#M24103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think it is related to the bug above since that has to do with formatting and this is a clear error when applying a date object to a date field. I wonder if the date object has to be formatted to match the date fields format in the geodatabase?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;yyyy-mm-dd hh:mm:ss AM or PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/help/data/tables/date-fields.htm" title="http://pro.arcgis.com/en/pro-app/help/data/tables/date-fields.htm"&gt;Date fields—ArcGIS Pro | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the above&amp;nbsp;workflows mentioned by Matthew and experienced the same error when applying a date to a date field but no error when applying it to a text field. I will look into it some more and post any updates I find.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 15:29:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480279#M24103</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-02T15:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can an arcade attribute rule update a date field?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480280#M24104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/Supriya_Khadke-esristaff"&gt;Supriya_Khadke-esristaff&lt;/A&gt;&amp;nbsp;, thanks for jumping in and investigate on what might be the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think the date should be formatted (as string) when it will be stored as a date. Sending a date as date object should work, since this avoids any misinterpretation due to differences in regional settings.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 15:46:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480280#M24104</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-02T15:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can an arcade attribute rule update a date field?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480281#M24105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might be a separate bug. I was able to add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var inputdate = date(2000,01,01)&lt;BR /&gt;return inputdate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To run the Calculate Field on a date field and the results were correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="397968" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/397968_pastedImage_1.png" style="width: 620px; height: 360px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, I logged a new bug:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;BUG-000112098 -&amp;nbsp;ERROR 000358: Invalid expression when applying an Arcade date function to a date field thru Attribute Rules&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 18:51:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/can-an-arcade-attribute-rule-update-a-date-field/m-p/480281#M24105</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-02T18:51:52Z</dc:date>
    </item>
  </channel>
</rss>

