<?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 Expression to Symbolize Past Due Assignments in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177264#M3599</link>
    <description>&lt;P&gt;I have a point feature that identifies locations to be inspected that month.&amp;nbsp; The feature has a "Due Date" attribute, which is typically the last day of the month.&lt;/P&gt;&lt;P&gt;I'd like to symbolize, in Field Maps, any point that has not been completed, based on the due date; so, I attempted to write the below arcade expression which looks at today's date, compares it to the month of the features due date attribute, and if the due date is the same month as Today(), then symbolize it as "Due This Month".&amp;nbsp; If the due date is last month, symbolize it as "Past Due":&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;var DateDifference = DateDiff(Today(), Month($feature["due_date"]), "month")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;if (DateDifference &amp;lt; 1){&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;return 'Due This Month'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;} &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;else {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;return 'Past Due'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;The expression, however, doesn't appear to work... everything regardless of the due date (even if the due date is the end of this month) is being symbolized as "Past Due".&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Any guidance would be appreciated.&amp;nbsp; I'm a novice w/ arcade expressions.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 16:38:39 GMT</pubDate>
    <dc:creator>JasonCyphers</dc:creator>
    <dc:date>2022-05-25T16:38:39Z</dc:date>
    <item>
      <title>Arcade Expression to Symbolize Past Due Assignments</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177264#M3599</link>
      <description>&lt;P&gt;I have a point feature that identifies locations to be inspected that month.&amp;nbsp; The feature has a "Due Date" attribute, which is typically the last day of the month.&lt;/P&gt;&lt;P&gt;I'd like to symbolize, in Field Maps, any point that has not been completed, based on the due date; so, I attempted to write the below arcade expression which looks at today's date, compares it to the month of the features due date attribute, and if the due date is the same month as Today(), then symbolize it as "Due This Month".&amp;nbsp; If the due date is last month, symbolize it as "Past Due":&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;var DateDifference = DateDiff(Today(), Month($feature["due_date"]), "month")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;if (DateDifference &amp;lt; 1){&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;return 'Due This Month'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;} &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;else {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;return 'Past Due'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;The expression, however, doesn't appear to work... everything regardless of the due date (even if the due date is the end of this month) is being symbolized as "Past Due".&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Any guidance would be appreciated.&amp;nbsp; I'm a novice w/ arcade expressions.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 16:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177264#M3599</guid>
      <dc:creator>JasonCyphers</dc:creator>
      <dc:date>2022-05-25T16:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to Symbolize Past Due Assignments</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177288#M3601</link>
      <description>&lt;P&gt;I'm assuming that this is a form Calculation and that this calculation is on the field that controls symbology (unique renderer).&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;below is on the right track with DateDiff. DateDiff aside, be&amp;nbsp;careful with the Month function it is zero indexed. So January is 0 and December is 11.&amp;nbsp; When using it you might need to do&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Month($feature["due_date"]) +1.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 17:29:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177288#M3601</guid>
      <dc:creator>JustinReynolds</dc:creator>
      <dc:date>2022-05-25T17:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to Symbolize Past Due Assignments</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177290#M3602</link>
      <description>&lt;P&gt;I think the key is "Month($feature["due_date"])".&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Month&lt;/STRONG&gt; is going to return a number corresponding to the month, whereas&amp;nbsp;&lt;STRONG&gt;DateDiff&lt;/STRONG&gt; is looking for two datetime values.&lt;/P&gt;&lt;P&gt;Tip: Make use of the&amp;nbsp;&lt;STRONG&gt;Console&lt;/STRONG&gt; function to print out intermediate values to double-check things.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1653499299125.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42142iA0E1A86958969AED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1653499299125.png" alt="jcarlson_0-1653499299125.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I was using&amp;nbsp;&lt;STRONG&gt;Month&lt;/STRONG&gt; on the other date, I would more easily catch this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1653499444735.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42143i87CD3EE2817A3D19/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1653499444735.png" alt="jcarlson_1-1653499444735.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, just try running your expression against the two dates and leave the&amp;nbsp;&lt;STRONG&gt;Month&lt;/STRONG&gt; function out.&lt;/P&gt;&lt;P&gt;Also, when it's a simple either/or,&amp;nbsp;&lt;STRONG&gt;Iif&lt;/STRONG&gt; can be more concise to write than a full if... else block.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 17:25:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177290#M3602</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-05-25T17:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to Symbolize Past Due Assignments</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177296#M3604</link>
      <description>&lt;P&gt;The reason it's always returning 'Past Due' is the Month function will return a number between 0 and 11. The DateDiff function sees the second parameter as just a number, not a date, so it return NaN (not a number). You should use this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var DateDifference = DateDiff(Today(), $feature.["due_date"], 'month')&lt;/LI-CODE&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>Wed, 25 May 2022 17:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1177296#M3604</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-05-25T17:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to Symbolize Past Due Assignments</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1670728#M12040</link>
      <description>&lt;P&gt;How would you do this but with the exact date instead of just the month?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 23:10:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-symbolize-past-due/m-p/1670728#M12040</guid>
      <dc:creator>Krocha</dc:creator>
      <dc:date>2025-12-04T23:10:32Z</dc:date>
    </item>
  </channel>
</rss>

