<?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: Using Iif or When (or something else) in advanced formatting section in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-iif-or-when-or-something-else-in-advanced/m-p/1310959#M8147</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;thank you for the explanation!&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2023 12:37:35 GMT</pubDate>
    <dc:creator>dwold</dc:creator>
    <dc:date>2023-07-24T12:37:35Z</dc:date>
    <item>
      <title>Using Iif or When (or something else) in advanced formatting section</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-iif-or-when-or-something-else-in-advanced/m-p/1310822#M8145</link>
      <description>&lt;P&gt;I need to return an icon based on an attribute value and I am not sure if I need to you when or Iif statement...or something else. I believe I need to change something in lines 3-7 but I am new to Advanced formatting with arcade. This is what I have tried:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dwold_0-1690132493468.png" style="width: 538px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/76048iF8844864CD146B64/image-dimensions/538x261?v=v2" width="538" height="261" role="button" title="dwold_0-1690132493468.png" alt="dwold_0-1690132493468.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dwold_1-1690132548544.png" style="width: 541px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/76049i169D5861FD10C98E/image-dimensions/541x261?v=v2" width="541" height="261" role="button" title="dwold_1-1690132548544.png" alt="dwold_1-1690132548544.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dwold_0-1690142419846.png" style="width: 146px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/76051i2074476022CCBFFC/image-dimensions/146x187?v=v2" width="146" height="187" role="button" title="dwold_0-1690142419846.png" alt="dwold_0-1690142419846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/236505"&gt;@MPach&lt;/a&gt;&amp;nbsp;&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;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 20:00:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/using-iif-or-when-or-something-else-in-advanced/m-p/1310822#M8145</guid>
      <dc:creator>dwold</dc:creator>
      <dc:date>2023-07-23T20:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Iif or When (or something else) in advanced formatting section</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-iif-or-when-or-something-else-in-advanced/m-p/1310950#M8146</link>
      <description>&lt;P&gt;Using &lt;STRONG&gt;When&lt;/STRONG&gt; is fine, but you need a final "default value" that the function will return if none of the conditions are met.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var icon = When(
  condition1, 'this',
  condition2, 'that',
  condition3, 'the other',
  'something else'
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Iif is for true/false situations, and can only return one of two values.&lt;/P&gt;&lt;P&gt;There's also &lt;STRONG&gt;Decode&lt;/STRONG&gt;, which takes an input value and compares it against a list of other values, similar to what you're doing here. As with When, you need a final default value.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var icon = Decode(
  s,
  '#00ff00', 'green',
  '#ff0000', 'red',
  '#ffff00', 'yellow',
  'something else'
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 12:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/using-iif-or-when-or-something-else-in-advanced/m-p/1310950#M8146</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-07-24T12:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using Iif or When (or something else) in advanced formatting section</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-iif-or-when-or-something-else-in-advanced/m-p/1310959#M8147</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;thank you for the explanation!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 12:37:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/using-iif-or-when-or-something-else-in-advanced/m-p/1310959#M8147</guid>
      <dc:creator>dwold</dc:creator>
      <dc:date>2023-07-24T12:37:35Z</dc:date>
    </item>
  </channel>
</rss>

