<?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 List advance formatting colors in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advance-formatting-colors/m-p/1574365#M10649</link>
    <description>&lt;P&gt;That should work if you're using the proper color codes. This code show an example of changing the background color using a When function and the text color using an Iif function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var theDate = Text($datapoint.FishDate, 'MMMM D, Y');

var bgColor = When(theDate  == 'June 6, 2023', '#FF0000',
                   theDate  == 'June 7, 2023', '#FFFF00',
                   theDate == '', '#ffffff',  
                   '#e2e2e2');
var textColor = Iif(theDate  == 'June 6, 2023', '#ffffff', '#000000');

return {
  textColor: textColor,
  backgroundColor: bgColor
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_7667e3.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123115i49CD161C3D0CA8D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_7667e3.png" alt="Snag_7667e3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2025 15:32:38 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2025-01-10T15:32:38Z</dc:date>
    <item>
      <title>Dashboard List advance formatting colors</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advance-formatting-colors/m-p/1573977#M10641</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to make a list of products ('name') that have different deadlines ('tr_datetime_finished').&lt;/P&gt;&lt;P&gt;I want the background color to change according to the time to the deadline. something like 5 t deadline is red, 10 yellow, and rest green&lt;/P&gt;&lt;P&gt;I am doing something wrong when using the advanced formatting only for two colors:&lt;/P&gt;&lt;P&gt;Can someone give me a hand?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var endDate=§datapoint['tr_datetime_finished']
var startDate= Today()
var timetoFinish = DateDiff(endDate, StartDate, 'days')

var color = iff(timetoFinish &amp;lt; 5, 'color1', 'color2')

return {
      backgroundColor: color,
}&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;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Pedro&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 16:34:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advance-formatting-colors/m-p/1573977#M10641</guid>
      <dc:creator>PSGeo</dc:creator>
      <dc:date>2025-01-09T16:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard List advance formatting colors</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advance-formatting-colors/m-p/1574365#M10649</link>
      <description>&lt;P&gt;That should work if you're using the proper color codes. This code show an example of changing the background color using a When function and the text color using an Iif function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var theDate = Text($datapoint.FishDate, 'MMMM D, Y');

var bgColor = When(theDate  == 'June 6, 2023', '#FF0000',
                   theDate  == 'June 7, 2023', '#FFFF00',
                   theDate == '', '#ffffff',  
                   '#e2e2e2');
var textColor = Iif(theDate  == 'June 6, 2023', '#ffffff', '#000000');

return {
  textColor: textColor,
  backgroundColor: bgColor
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_7667e3.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123115i49CD161C3D0CA8D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_7667e3.png" alt="Snag_7667e3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 15:32:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advance-formatting-colors/m-p/1574365#M10649</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-01-10T15:32:38Z</dc:date>
    </item>
  </channel>
</rss>

