<?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: Help with Arcade (date) in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556470#M40933</link>
    <description>&lt;P&gt;Yes I am. All based off of a date field.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 19:24:40 GMT</pubDate>
    <dc:creator>Laura</dc:creator>
    <dc:date>2024-11-07T19:24:40Z</dc:date>
    <item>
      <title>Help with Arcade (date)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556364#M40928</link>
      <description>&lt;P&gt;Still very new to Arcade and trying to copy from a script I saw on the community.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I get an error when using this: Expression must return a number value. Any help is appreciated! I am testing this out with the last edit date Esri field but will eventually be adding in another field that calculates the date of an inspection.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;var edit_datetime = Date($feature.last_edited_date);&lt;/P&gt;&lt;P&gt;var result = "No information available";&lt;BR /&gt;if (IsEmpty(edit_datetime)) {&lt;BR /&gt;result = "Invalid date";&lt;BR /&gt;} else {&lt;BR /&gt;var now_datetime = Now();&lt;BR /&gt;var days_dif = DateDiff(now_datetime, edit_datetime, "days");&lt;BR /&gt;var today_date = Today();&lt;BR /&gt;var edit_date = Date(Year(edit_datetime), Month(edit_datetime), Day(edit_datetime));&lt;BR /&gt;if (today_date == edit_date) {&lt;BR /&gt;result = "Inspected today";&lt;BR /&gt;} else if (days_dif &amp;lt; 31) {&lt;BR /&gt;result = "Inspected Recently (Within Last Month)";&lt;BR /&gt;} else if (days_dif &amp;lt; 90) {&lt;BR /&gt;result = "Inspected (Within Last 3 Months)";&lt;BR /&gt;} else {&lt;BR /&gt;result = "Not Inspected";&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return result;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 16:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556364#M40928</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2024-11-07T16:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade (date)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556380#M40929</link>
      <description>&lt;P&gt;The script works if I put in another date field or just a date. Are you using this to calculate a field? If so, I'm guessing field is numeric while your script is returning text.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 17:07:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556380#M40929</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-11-07T17:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade (date)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556385#M40930</link>
      <description>&lt;P&gt;Not calculating another field. I switched to map viewer classic and the error went away. Wonder if there is a bug of some sort in map viewer. I am on 11.2&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 17:26:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556385#M40930</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2024-11-14T17:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade (date)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556443#M40932</link>
      <description>&lt;P&gt;Are you using the output to drive symbology?&lt;/P&gt;&lt;P&gt;I've seen this error trying to use two fields for symbology. One needs to be numeric. might need to use a single expression, instead of combining with a field.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 18:40:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556443#M40932</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-11-07T18:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade (date)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556470#M40933</link>
      <description>&lt;P&gt;Yes I am. All based off of a date field.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 19:24:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556470#M40933</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2024-11-07T19:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arcade (date)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556482#M40934</link>
      <description>&lt;P&gt;If you have one field or expression on the layer using non-numeric values, you can't add a second field or expression using non-numeric values. The second variable must be numeric.&lt;/P&gt;&lt;P&gt;As the arcade expression seems fine and you're seeing an error in line with the above it could be this limitation you are seeing.&lt;/P&gt;&lt;P&gt;Try joining the two values into a single expression, or returning numeric values in this expression.&lt;/P&gt;&lt;P&gt;If you only want the single arcade expression driving symbology, can you share some screenshots on how you are applying it? Could be a minor workflow thing where you're adding a second variable instead of replacing the exisiting, or something specific to your version of Enterprise.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 19:42:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/help-with-arcade-date/m-p/1556482#M40934</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-11-07T19:42:01Z</dc:date>
    </item>
  </channel>
</rss>

