<?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: Dashboard Advanced Formatting Arcade in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1241712#M7115</link>
    <description>&lt;P&gt;I realized I forgot to add IsEmpty. I added it&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF($datapoint.firstpostda1 &amp;gt; 48, "#BE2528", "") || IIF(!IsEmpty($datapoint.campclosedate), " ","")&lt;/P&gt;&lt;P&gt;But now I get "&lt;SPAN&gt;Runtime Error: Operator || cannot be used. Only || or &amp;amp;&amp;amp; are allowed values"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Which I don't understand. I am using the key above the enter key to input the ||. Should I use a different key?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Annette&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2022 20:10:33 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-12-15T20:10:33Z</dc:date>
    <item>
      <title>Dashboard Advanced Formatting Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1239736#M7081</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Having issues trying to get this to work.&amp;nbsp; I am in dashboard using list widget, advanced formatting. The goal is if&lt;/P&gt;&lt;P&gt;#1. postdate &amp;gt; 48 hours, background changes to red.&amp;nbsp;&lt;/P&gt;&lt;P&gt;#2. but if postdate is empty or if there is a close date, do nothing&lt;/P&gt;&lt;P&gt;#3. also if there is no postdate or no close date, do nothing.&lt;/P&gt;&lt;P&gt;I can get a part of it to work but not all of it.&amp;nbsp; I have tried using IIF and WHEN.&lt;/P&gt;&lt;P&gt;What I have tried and the results. All help is appreciated.&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF(IsEmpty($datapoint.campclosedate) &amp;amp;&amp;amp; (currentdate &amp;gt; twodayslater), " ", "#BE2528")&lt;/P&gt;&lt;P&gt;When using the above&amp;nbsp; #1, #3 work&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF((currentdate &amp;gt; twodayslater)," ", "#BE2528")&lt;/P&gt;&lt;P&gt;When using the above&amp;nbsp; #2, #3 work&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF(!IsEmpty($datapoint.campclosedate) &amp;amp;&amp;amp; (currentdate &amp;gt; twodayslater), " ", "#BE2528 ")&lt;/P&gt;&lt;P&gt;When using the above # 1, #2 work&lt;/P&gt;&lt;P&gt;&amp;nbsp;var pastduecolor = When(IsEmpty($datapoint.campclosedate) &amp;amp;&amp;amp; (currentdate &amp;gt; twodayslater), "#BE2528", IsEmpty($datapoint.firstpostda1) &amp;amp;&amp;amp; IsEmpty($datapoint.campclosedate), " ", " ")&lt;/P&gt;&lt;P&gt;When using above #1, #2 work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very&amp;nbsp; much,&lt;/P&gt;&lt;P&gt;Annette&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 18:03:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1239736#M7081</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-12-09T18:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Advanced Formatting Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1239761#M7082</link>
      <description>&lt;P&gt;Looking at your conditions, "postdate is empty" is present in both conditions 2 and 3. And then you are specifying checking whether or not there is a close date, but if I read your post correctly, you want the background to be blank whether or not there &lt;EM&gt;is&lt;/EM&gt; a close date.&lt;/P&gt;&lt;P&gt;Put simply, I don't see the dstinction between #2 and #3 the way you're describing it.&lt;/P&gt;&lt;P&gt;Also, the result of those two conditions is to not apply any color. If we default the background color to being blank, then you really only need to adjust that value for cases where it matters. A successful execution of items 2 and 3 would be identical to nothing happening at all, right?&lt;/P&gt;&lt;PRE&gt;Iif($feature.postdate &amp;gt; 48, 'red', '')&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 18:41:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1239761#M7082</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-12-09T18:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Advanced Formatting Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1241703#M7114</link>
      <description>&lt;P&gt;Hello Josh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are correct, item 2 and 3, nothing happens. When I apply&amp;nbsp;&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF($datapoint.firstpostda1 &amp;gt; 48, "#BE2528", "")&lt;/P&gt;&lt;P&gt;it turns red if the postdate is past 48 hours and if there is a close date. If there is a close date, then no need to turn red. I am trying to add an "or" to the statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If post due date is &amp;gt; 48 hours turn red or if closed date is not empty, do nothing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I get "unexpected string"&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF($datapoint.firstpostda1 &amp;gt; 48, "#BE2528", "") || IIF(!$datapoint.campclosedate), " ")&lt;/P&gt;&lt;P&gt;I also tried&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF($datapoint.firstpostda1 &amp;gt; 48, "#BE2528", "") || IIF(!$datapoint.campclosedate), " ","")&lt;/P&gt;&lt;P&gt;I am thinking it has something to do with the parenthesis?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know. Your help is always appreciated.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Annette&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 19:57:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1241703#M7114</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-12-15T19:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Advanced Formatting Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1241712#M7115</link>
      <description>&lt;P&gt;I realized I forgot to add IsEmpty. I added it&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF($datapoint.firstpostda1 &amp;gt; 48, "#BE2528", "") || IIF(!IsEmpty($datapoint.campclosedate), " ","")&lt;/P&gt;&lt;P&gt;But now I get "&lt;SPAN&gt;Runtime Error: Operator || cannot be used. Only || or &amp;amp;&amp;amp; are allowed values"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Which I don't understand. I am using the key above the enter key to input the ||. Should I use a different key?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Annette&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 20:10:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1241712#M7115</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-12-15T20:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Advanced Formatting Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1242420#M7124</link>
      <description>&lt;P&gt;Hello Josh&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I thought this would work.&amp;nbsp; If post date is greater than 48 hours, turn red OR if camp close date is not empty turn green.&amp;nbsp; BUT I get an error "&lt;SPAN class=""&gt;Parse Error:&lt;/SPAN&gt;&lt;SPAN&gt;Line 22: Unexpected token return".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;var pastduecolor = IIF($datapoint.firstpostda1 &amp;gt; 48, "#BE2528", "" || IIF(!IsEmpty($datapoint.campclosedate), " ","#BE25")&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;textColor: '',&lt;BR /&gt;backgroundColor: pastduecolor,&lt;BR /&gt;separatorColor:'#005ce6',&lt;BR /&gt;selectionColor: '',&lt;BR /&gt;selectionTextColor: '',&lt;BR /&gt;attributes: {&lt;BR /&gt;attribute1: pastduecolor,&lt;/P&gt;&lt;P&gt;Thank you. Annette&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 17:26:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1242420#M7124</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-12-19T17:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Advanced Formatting Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1244899#M7161</link>
      <description>&lt;P&gt;Hi Annette,&lt;/P&gt;&lt;P&gt;Just back from 2 weeks' vacation. I think the trouble here is that "||" and "&amp;amp;&amp;amp;" are used for boolean conditions that can evaluate to "true" or "false", something like&lt;/P&gt;&lt;PRE&gt;$datapoint.firstpostda1 &amp;gt; 48 || !IsEmpty($datapoint.campclosedate)&lt;/PRE&gt;&lt;P&gt;But the &lt;STRONG&gt;iif &lt;/STRONG&gt;function is returning strings, which won't evaluate properly. Also, when you have multiple conditions, linking them with || or &amp;amp;&amp;amp; really only makes sense if they have a single outcome. "If A or B, do X". Where you have two conditions and two outcomes, these really need to be separated.&lt;/P&gt;&lt;P&gt;So, taking the "plain English" version of your conditions:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;If post date is greater than 48 hours, turn red OR if camp close date is not empty turn green.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;We could just write it like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var pastduecolor;

if ($datapoint.firstpostda1 &amp;gt; 48){
    pastduecolor = "red"
} else if (!IsEmpty($datapoint.campclosedate)){
    pastduecolor = "green"
}&lt;/LI-CODE&gt;&lt;P&gt;Since these conditions aren't linked, the order matters. If the empty close date is more important than the other field, then just put it first.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 15:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1244899#M7161</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-01-03T15:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Advanced Formatting Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1245885#M7168</link>
      <description>&lt;P&gt;Hello Josh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you had a great vacation. I have tried several ways to do this, but never quite right.&amp;nbsp; I tried&lt;/P&gt;&lt;P&gt;var pastduecolor;&lt;/P&gt;&lt;P&gt;if(currentdate &amp;gt; twodayslater){&lt;BR /&gt;pastduecolor = "red"&lt;BR /&gt;} else if (!ISEmpty($datapoint.campclosedate)){&lt;BR /&gt;pastduecolor = "black"&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;textColor: '',&lt;BR /&gt;backgroundColor: pastduecolor,&lt;BR /&gt;separatorColor: '#005ce6',&lt;BR /&gt;selectionColor: '',&lt;BR /&gt;selectionTextColor: '',&lt;BR /&gt;attributes: {&lt;BR /&gt;// attribute1:&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;What I am getting is&lt;/P&gt;&lt;P&gt;- when there is no post date and no close date, it should be black, but its red&lt;/P&gt;&lt;P&gt;-when there is a post date &amp;gt; 48 and a close date, it should be black, but its red&lt;/P&gt;&lt;P&gt;Those are my two issues.&amp;nbsp; Basically the only item that works is post date &amp;gt; 48 hours turn red.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As you stated above "If post date is greater than 48 hours, turn red OR if camp close date is not empty turn black".&amp;nbsp; Plus these other two caveats --&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;no post date, no close date = black&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;close date = black.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any ideas? Thank you Josh.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Annette&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 22:27:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-advanced-formatting-arcade/m-p/1245885#M7168</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-01-05T22:27:56Z</dc:date>
    </item>
  </channel>
</rss>

