<?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: How to use Arcade Expression to dynamically change layer symbol based on time attribute in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44180#M2132</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/ANDRES_GUGLIELMETTI"&gt;ANDRES_GUGLIELMETTI&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that every action that will invoke a request to the server should apply the expression to it. So zoom in and zoom out should work and if you pan away and back, that might too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;As a little side note, you don't have to apply the Date() function if the DATATIME field is of type Date (same goes for the Now() function)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jun 2019 18:33:14 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2019-06-18T18:33:14Z</dc:date>
    <item>
      <title>How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44173#M2125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a point layer used for work permits. When the field crew pulls a new work permit they create a point via collector and complete attribute fields to document date permit was pulled and date permit will expire. I would like to have the ability to automate the change in symbology based on "time/date". Example, if permit is good for 14 days I want the symbol to be a green circle for the first 9 days and then change to an orange circle from days 10-14 and then change to a red circle days &amp;gt;14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2019 16:44:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44173#M2125</guid>
      <dc:creator>DamonNelton</dc:creator>
      <dc:date>2019-05-07T16:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44174#M2126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will not be visible in Collector, but in a web map you can use symbology based on the time passed. See example below:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// I assume you register the date the permit was created&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; date_permit_created &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;LASTUPDATE&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// change this for your date field&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; days_dif &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;DateDiff&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Now&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; date_permit_created&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"days"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Unknown"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;days_dif &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Green"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;days_dif &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;14&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Orange"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Red"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a catch... you will have to have some dummy data in order to define the different symbology classes. After defining the symbology the points could be removed from the layer.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:41:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44174#M2126</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T21:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44175#M2127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I was able to get that to work. Below is how I tweaked my use case if it helps anyone else who reads this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var days = Floor(DateDiff($feature["expired_on"], Today(), "days"),0) //Replace "expiration_date" with your field name&lt;/P&gt;&lt;P&gt;if (days &amp;gt; 4){&lt;BR /&gt; return 'Beyond 4 Days';&lt;BR /&gt;}&lt;BR /&gt;else if (days &amp;lt;= 4 &amp;amp;&amp;amp; days &amp;gt;= 1){&lt;BR /&gt; return '1-4 Days';&lt;BR /&gt;}&lt;BR /&gt;else if (days &amp;lt; 1){&lt;BR /&gt; return 'Expired';&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 12:47:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44175#M2127</guid>
      <dc:creator>DamonNelton</dc:creator>
      <dc:date>2019-05-09T12:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44176#M2128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great to see that it you have it working. Can you mark the question as solved?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 13:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44176#M2128</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-05-09T13:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44177#M2129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I would like to ask you how to automattically update the Today() field without&amp;nbsp;calculating it manually each day. I want to automatically display how many days have passed since one date in the past. Thanxs!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2019 15:39:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44177#M2129</guid>
      <dc:creator>andresguglielmetti</dc:creator>
      <dc:date>2019-06-11T15:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44178#M2130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can define your symbology on this Today() function and it will draw dynamically changing every day. You can also define the expression in the pop-up to show the updated information automatically. Only if you perform a field calculation you will create static information that will not update based on the current&amp;nbsp; day if the day is after the day for which the calculation was performed. What use case do you have?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 23:46:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44178#M2130</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-06-13T23:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44179#M2131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks. I was wondering if&amp;nbsp;"today" function updates automatically and the fields that depends on its calculation&amp;nbsp;updates their values dynamically. I have one DATATIME field taken from Survey123 inspections, then in webmap I added a field with "now()" and "DateDifference" in hours. So,&amp;nbsp;I want to&amp;nbsp;establish an alarm&amp;nbsp;performing dynamically when this difference is larger than 48 hours, so the webmap viewer can observe which survey is time exceeded. I had concerns about&amp;nbsp; this date difference. I figured out that its dynamically calculated so the viewer doesnt have to perform any calculation.&lt;/P&gt;&lt;P&gt;now I would like to know&amp;nbsp;about frequency does it refresh. Does it refresh when you refresh your webmap? or when you pan in the map?&lt;/P&gt;&lt;P&gt;I founded that the following code worked fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var startDate = Date($feature.DATATIME);&lt;BR /&gt;var endDate = Date(now());&lt;BR /&gt;var age = Round(DateDiff(endDate, startDate, 'hours'));&lt;BR /&gt;var estado = IIf (age&amp;gt;=48 , 'time exceeded ' , 'no&amp;nbsp;&lt;SPAN&gt;time exceeded&lt;/SPAN&gt;');&lt;BR /&gt;return estado&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2019 12:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44179#M2131</guid>
      <dc:creator>andresguglielmetti</dc:creator>
      <dc:date>2019-06-18T12:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44180#M2132</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/ANDRES_GUGLIELMETTI"&gt;ANDRES_GUGLIELMETTI&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that every action that will invoke a request to the server should apply the expression to it. So zoom in and zoom out should work and if you pan away and back, that might too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;As a little side note, you don't have to apply the Date() function if the DATATIME field is of type Date (same goes for the Now() function)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2019 18:33:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44180#M2132</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-06-18T18:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44181#M2133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx for your time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2019 18:42:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/44181#M2133</guid>
      <dc:creator>andresguglielmetti</dc:creator>
      <dc:date>2019-06-18T18:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/1155064#M44945</link>
      <description>&lt;P&gt;I have a similar question: Let's say that I have a date field that shows a future date like March 21, 2022, and I want to see the symbology for any dates before this date to be green but once this date is reached then the polygon turns red. Essentially future dates are green and past dates are red. Is this a similar Arcade script or is there a more simple way to go about this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 22:16:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/1155064#M44945</guid>
      <dc:creator>FrancisHourigan1</dc:creator>
      <dc:date>2022-03-17T22:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcade Expression to dynamically change layer symbol based on time attribute</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/1205477#M47551</link>
      <description>&lt;P&gt;Thank you both this helped me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 16:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-use-arcade-expression-to-dynamically-change/m-p/1205477#M47551</guid>
      <dc:creator>GISelleRangel1</dc:creator>
      <dc:date>2022-08-23T16:54:59Z</dc:date>
    </item>
  </channel>
</rss>

