<?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 for custom symbology in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-custom-symbology/m-p/439755#M22201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read several different blogs and postings to try and achieve a task in ArcGIS Online.&amp;nbsp; I would like too, based on two fields provide a custom image for a symbol for my webmap.&amp;nbsp; I want users to nominate an issue (i.e. snake sighting), and then calculate a period of time for when the webmap is viewed, to have the symbol change with age from a 'High' (&amp;lt;12 hours) indicent to 'Low' (&amp;gt; 48 hours) incident. So over the course of 2 days the symbol might change from a red snake to a green one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code is my attempt so far to at least show the correct image within a pop-up.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var startDate = Date($feature.date);
var endDate = Now();
var age = DateDiff(endDate, startDate, 'hours');
When (
&amp;nbsp;&amp;nbsp;&amp;nbsp; age &amp;lt;= 12,'High',
&amp;nbsp;&amp;nbsp;&amp;nbsp; age &amp;gt; 12 &amp;amp;&amp;amp; age &amp;lt;= 24, 'Medium',
&amp;nbsp;&amp;nbsp;&amp;nbsp; age &amp;gt; 24 &amp;amp;&amp;amp; age &amp;lt;= 48, 'Low','Historical');

var issue = ($feature.issue)

if (issue == 'Snake' &amp;amp;&amp;amp; age == 'High'){
return "snake1.png"
} else 
if (issue == 'Snake' &amp;amp;&amp;amp; age == 'Medium'){
return "snake2.png"
} else
if (issue == 'Snake' &amp;amp;&amp;amp; age == 'Low'){
return "snake3.png"
} else
{
return "bird1.png"
}&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;/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;I am finding that the bird1.png is showing, even though I only have snake events in my data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I ultimately want is a custom symbol using my PNG file, and then go one step further to place a buffer of set distance around point locations and color those with incident level (red/amber/green).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hoping this is something Arcade might be able to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Craig&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:40:35 GMT</pubDate>
    <dc:creator>CPoynter</dc:creator>
    <dc:date>2021-12-11T19:40:35Z</dc:date>
    <item>
      <title>Arcade expression for custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-custom-symbology/m-p/439755#M22201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read several different blogs and postings to try and achieve a task in ArcGIS Online.&amp;nbsp; I would like too, based on two fields provide a custom image for a symbol for my webmap.&amp;nbsp; I want users to nominate an issue (i.e. snake sighting), and then calculate a period of time for when the webmap is viewed, to have the symbol change with age from a 'High' (&amp;lt;12 hours) indicent to 'Low' (&amp;gt; 48 hours) incident. So over the course of 2 days the symbol might change from a red snake to a green one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code is my attempt so far to at least show the correct image within a pop-up.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var startDate = Date($feature.date);
var endDate = Now();
var age = DateDiff(endDate, startDate, 'hours');
When (
&amp;nbsp;&amp;nbsp;&amp;nbsp; age &amp;lt;= 12,'High',
&amp;nbsp;&amp;nbsp;&amp;nbsp; age &amp;gt; 12 &amp;amp;&amp;amp; age &amp;lt;= 24, 'Medium',
&amp;nbsp;&amp;nbsp;&amp;nbsp; age &amp;gt; 24 &amp;amp;&amp;amp; age &amp;lt;= 48, 'Low','Historical');

var issue = ($feature.issue)

if (issue == 'Snake' &amp;amp;&amp;amp; age == 'High'){
return "snake1.png"
} else 
if (issue == 'Snake' &amp;amp;&amp;amp; age == 'Medium'){
return "snake2.png"
} else
if (issue == 'Snake' &amp;amp;&amp;amp; age == 'Low'){
return "snake3.png"
} else
{
return "bird1.png"
}&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;/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;I am finding that the bird1.png is showing, even though I only have snake events in my data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I ultimately want is a custom symbol using my PNG file, and then go one step further to place a buffer of set distance around point locations and color those with incident level (red/amber/green).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hoping this is something Arcade might be able to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Craig&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:40:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-custom-symbology/m-p/439755#M22201</guid>
      <dc:creator>CPoynter</dc:creator>
      <dc:date>2021-12-11T19:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-custom-symbology/m-p/439756#M22202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The variable &lt;EM&gt;age&lt;/EM&gt; isn't getting set to "High", "Medium", or "Low", so the if statements are defaulting to returning the bird icon. The When statement returns the values, but you have to instantiate a variable to hold the return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; ageDate &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;endDate&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; startDate&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'hours'&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; age &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; When &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ageDate &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'High'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ageDate &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;12&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; ageDate &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;24&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Medium'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ageDate &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;24&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; ageDate &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;48&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Low'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Historical'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;What happens to historical dates with the snake sightings? In your code, since you don't account for that, it would also return a bird.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:40:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-custom-symbology/m-p/439756#M22202</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T19:40:37Z</dc:date>
    </item>
  </channel>
</rss>

