<?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: Conditional text color change in table widget in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/conditional-text-color-change-in-table-widget/m-p/1651558#M11440</link>
    <description>&lt;P&gt;There are a couple of ways to do that. You can put a simple IIf function in the backgroundColor property to change it if it's a certain value.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return {
  cells: {
    Portfolio_1: {
      displayText : Text($datapoint.Portfolio_1),
      textColor: '',
      backgroundColor: iif($datapoint.Portfolio_1 == 1, "#ff0000",""),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },&lt;/LI-CODE&gt;&lt;P&gt;which will give you this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-09-18_13-39-33.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140664i6B473B0FEA4E11BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2025-09-18_13-39-33.PNG" alt="2025-09-18_13-39-33.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you want to apply that logic to several columns, a better way would be to use a function that determines whether the cell should have a red background color, using the value of the $datapoints of the various columns.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function bgColor(input) {
  if (input == 1) return "#ff0000"
}

return {
  cells: {
    Portfolio_1: {
      displayText : Text($datapoint.Portfolio_1),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_1),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_2: {
      displayText : Text($datapoint.Portfolio_2),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_2),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_3: {
      displayText : Text($datapoint.Portfolio_3),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_3),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_4: {
      displayText : Text($datapoint.Portfolio_4),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_4),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_5: {
      displayText : Text($datapoint.Portfolio_5),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_5),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
  }
}&lt;/LI-CODE&gt;&lt;P&gt;which results in this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-09-18_13-42-25.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140665i2A81551CF44EAF3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2025-09-18_13-42-25.PNG" alt="2025-09-18_13-42-25.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Sep 2025 17:43:15 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2025-09-18T17:43:15Z</dc:date>
    <item>
      <title>Conditional text color change in table widget</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/conditional-text-color-change-in-table-widget/m-p/1651535#M11439</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;i've seen you help others in similar situations.&lt;/P&gt;&lt;P&gt;I want to update some of the text formatting in my table. Before switching to advanced formatting, the table displayed "Yes" when the cell value was 1 and "No" when the value was 2. Now, I’d like to highlight the problematic cells — for example, by changing the text or background color. Specifically, if the cell shows "Yes" (or has a value of 1), I want it to be highlighted in red.&lt;/P&gt;&lt;P&gt;So far, everything I’ve tried either produces errors or only changes the text color of the entire column, not just the individual cells. How can I apply conditional formatting to only those specific cells?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Laura_0-1758213468595.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140660i2E448A7A9C105502/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Laura_0-1758213468595.png" alt="Laura_0-1758213468595.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 16:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/conditional-text-color-change-in-table-widget/m-p/1651535#M11439</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2025-09-18T16:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional text color change in table widget</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/conditional-text-color-change-in-table-widget/m-p/1651558#M11440</link>
      <description>&lt;P&gt;There are a couple of ways to do that. You can put a simple IIf function in the backgroundColor property to change it if it's a certain value.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return {
  cells: {
    Portfolio_1: {
      displayText : Text($datapoint.Portfolio_1),
      textColor: '',
      backgroundColor: iif($datapoint.Portfolio_1 == 1, "#ff0000",""),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },&lt;/LI-CODE&gt;&lt;P&gt;which will give you this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-09-18_13-39-33.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140664i6B473B0FEA4E11BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2025-09-18_13-39-33.PNG" alt="2025-09-18_13-39-33.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you want to apply that logic to several columns, a better way would be to use a function that determines whether the cell should have a red background color, using the value of the $datapoints of the various columns.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function bgColor(input) {
  if (input == 1) return "#ff0000"
}

return {
  cells: {
    Portfolio_1: {
      displayText : Text($datapoint.Portfolio_1),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_1),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_2: {
      displayText : Text($datapoint.Portfolio_2),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_2),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_3: {
      displayText : Text($datapoint.Portfolio_3),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_3),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_4: {
      displayText : Text($datapoint.Portfolio_4),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_4),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    Portfolio_5: {
      displayText : Text($datapoint.Portfolio_5),
      textColor: '',
      backgroundColor: bgColor($datapoint.Portfolio_5),
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
  }
}&lt;/LI-CODE&gt;&lt;P&gt;which results in this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-09-18_13-42-25.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140665i2A81551CF44EAF3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2025-09-18_13-42-25.PNG" alt="2025-09-18_13-42-25.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 17:43:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/conditional-text-color-change-in-table-widget/m-p/1651558#M11440</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-09-18T17:43:15Z</dc:date>
    </item>
  </channel>
</rss>

