<?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 Using Arcade expressions to format specific values in Dashboard table field in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1322408#M8366</link>
    <description>&lt;P&gt;I've been working from &lt;A href="https://community.esri.com/t5/arcgis-dashboards-blog/make-use-of-html-in-your-dashboard-tables-too/ba-p/1258081" target="_self"&gt;both&lt;/A&gt; of &lt;A href="https://www.esri.com/arcgis-blog/products/ops-dashboard/real-time/arcade-tips-for-tables-in-arcgis-dashboards/" target="_self"&gt;these&lt;/A&gt; helpful posts about using Arcade to format values and cells in dashboard tables.&lt;/P&gt;&lt;P&gt;I've been able to do some things, such as formatting numbers and percentages. But I haven't been able to figure out how to bold specific values in a column and, for other values, change textAlign from left to center.&lt;/P&gt;&lt;P&gt;I can use displayText to make all values bold, or textAlign to make all values center aligned. My goal, though, is to make those changes for just certain values in the column.&lt;/P&gt;&lt;P&gt;Below is my desired output for the "Revenue Source" field. Thank you for any suggestions.&lt;/P&gt;&lt;TABLE width="173"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="172.2px" height="25px"&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Revenue Source&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&lt;STRONG&gt;Personal Income&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Withholding&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Other Pmts&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Refunds&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&lt;STRONG&gt;Corporation&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Estimated Pmts&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp; &amp;nbsp;Other Pmts&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&lt;STRONG&gt;All Other Revenue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Insurance&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Tobacco&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Other&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2023 05:39:21 GMT</pubDate>
    <dc:creator>JimMiller3</dc:creator>
    <dc:date>2023-08-25T05:39:21Z</dc:date>
    <item>
      <title>Using Arcade expressions to format specific values in Dashboard table field</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1322408#M8366</link>
      <description>&lt;P&gt;I've been working from &lt;A href="https://community.esri.com/t5/arcgis-dashboards-blog/make-use-of-html-in-your-dashboard-tables-too/ba-p/1258081" target="_self"&gt;both&lt;/A&gt; of &lt;A href="https://www.esri.com/arcgis-blog/products/ops-dashboard/real-time/arcade-tips-for-tables-in-arcgis-dashboards/" target="_self"&gt;these&lt;/A&gt; helpful posts about using Arcade to format values and cells in dashboard tables.&lt;/P&gt;&lt;P&gt;I've been able to do some things, such as formatting numbers and percentages. But I haven't been able to figure out how to bold specific values in a column and, for other values, change textAlign from left to center.&lt;/P&gt;&lt;P&gt;I can use displayText to make all values bold, or textAlign to make all values center aligned. My goal, though, is to make those changes for just certain values in the column.&lt;/P&gt;&lt;P&gt;Below is my desired output for the "Revenue Source" field. Thank you for any suggestions.&lt;/P&gt;&lt;TABLE width="173"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="172.2px" height="25px"&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Revenue Source&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&lt;STRONG&gt;Personal Income&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Withholding&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Other Pmts&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Refunds&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&lt;STRONG&gt;Corporation&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Estimated Pmts&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp; &amp;nbsp;Other Pmts&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&lt;STRONG&gt;All Other Revenue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Insurance&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Tobacco&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="172.2px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Other&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 05:39:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1322408#M8366</guid>
      <dc:creator>JimMiller3</dc:creator>
      <dc:date>2023-08-25T05:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade expressions to format specific values in Dashboard table field</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1322485#M8368</link>
      <description>&lt;P&gt;You need to have your arcade statement return HTML that does your desired formatting.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var bld = Concatenate('&amp;lt;strong&amp;gt;'+$datapoint.COUNTRY+'&amp;lt;/strong&amp;gt;')

var lft = Concatenate('&amp;lt;div style="text-align: center;"&amp;gt;' +$datapoint.COUNTRY+ '&amp;lt;/div&amp;gt;')

var blft = Concatenate('&amp;lt;div style="text-align: center;"&amp;gt;&amp;lt;strong&amp;gt;' +$datapoint.COUNTRY+ '&amp;lt;/strong&amp;gt;&amp;lt;/div&amp;gt;')

var ctry = When($datapoint.COUNTRY == 'Cameroon', bld, $datapoint.COUNTRY == 'Angola', lft, $datapoint.COUNTRY == 'Ethiopia', blft,$datapoint.COUNTRY )

return {
  cells: {
    ADMIN1: {
      displayText : $datapoint.ADMIN1,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    ADMIN2: {
      displayText : $datapoint.ADMIN2,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    COUNTRY: {
      displayText : ctry,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JenniferAcunto_1-1692968132005.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79135iDAD50BD6850A2498/image-size/large?v=v2&amp;amp;px=999" role="button" title="JenniferAcunto_1-1692968132005.png" alt="JenniferAcunto_1-1692968132005.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 12:56:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1322485#M8368</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2023-08-25T12:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade expressions to format specific values in Dashboard table field</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1322689#M8371</link>
      <description>&lt;P&gt;Thanks - that worked perfectly.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 20:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1322689#M8371</guid>
      <dc:creator>JimMiller3</dc:creator>
      <dc:date>2023-08-25T20:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade expressions to format specific values in Dashboard table field</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1339260#M8598</link>
      <description>&lt;P&gt;A follow-up question to the solution above &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/160974"&gt;@JenniferAcunto&lt;/a&gt;&amp;nbsp;: If I want to also bold the values in the "Actual" and "Forecast" fields that correspond with the bolded values in the "Revenue Source" field, how do I structure the HTML and Arcade expression? I've tried several ways but I'm not getting the desired result&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var bld = Concatenate('&amp;lt;strong&amp;gt;'+$datapoint.revenue_source+'&amp;lt;/strong&amp;gt;')

var rsrc=When($datapoint.revenue_source == 'Personal Income', bld, $datapoint.revenue_source == 'Corporation',$datapoint.revenue_source == 'Total',$datapoint.revenue_source == 'All Other Revenue'

return {
  cells: {
    revenue_source: {
      displayText : rsrc,
      hoverText: $datapoint.revenue_source,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },

Actual: {
      displayText: Text($datapoint["Actual"], '$#,###; -$#,###'),
      textColor: '',
      backgroundColor: '',
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },

Forecast: {
      displayText: Text($datapoint["Forecast"], '$#,###; -$#,###'),
      textColor: '',
      backgroundColor: '',
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },&lt;/LI-CODE&gt;&lt;P&gt;This is my desired result. Thank you.&lt;/P&gt;&lt;TABLE width="251"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="115.463px" height="46px"&gt;&lt;STRONG&gt;Revenue Source&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="61.8875px" height="46px"&gt;&lt;STRONG&gt;Actual&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="72.85px" height="46px"&gt;&lt;STRONG&gt;Forecast&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="46px"&gt;&lt;STRONG&gt;Personal Income&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="61.8875px" height="46px"&gt;&lt;STRONG&gt;100&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="72.85px" height="46px"&gt;&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Withholding&lt;/TD&gt;&lt;TD width="61.8875px" height="24px"&gt;25&lt;/TD&gt;&lt;TD width="72.85px" height="24px"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Other Pmts&lt;/TD&gt;&lt;TD width="61.8875px" height="24px"&gt;25&lt;/TD&gt;&lt;TD width="72.85px" height="24px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="24px"&gt;&amp;nbsp;&amp;nbsp; Refunds&lt;/TD&gt;&lt;TD width="61.8875px" height="24px"&gt;50&lt;/TD&gt;&lt;TD width="72.85px" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="24px"&gt;&lt;STRONG&gt;Corporation&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="61.8875px" height="24px"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="72.85px" height="24px"&gt;&lt;STRONG&gt;100&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="46px"&gt;&amp;nbsp;&amp;nbsp; Estimated Pmts&lt;/TD&gt;&lt;TD width="61.8875px" height="46px"&gt;100&lt;/TD&gt;&lt;TD width="72.85px" height="46px"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="24px"&gt;&amp;nbsp; &amp;nbsp;Other Pmts&lt;/TD&gt;&lt;TD width="61.8875px" height="24px"&gt;100&lt;/TD&gt;&lt;TD width="72.85px" height="24px"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="46px"&gt;&lt;STRONG&gt;All Other Revenue&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="61.8875px" height="46px"&gt;&lt;STRONG&gt;300&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="72.85px" height="46px"&gt;&lt;STRONG&gt;500&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="115.463px" height="24px"&gt;&lt;STRONG&gt;Total&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="61.8875px" height="24px"&gt;&lt;STRONG&gt;600&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="72.85px" height="24px"&gt;&lt;STRONG&gt;650&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 18 Oct 2023 18:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/using-arcade-expressions-to-format-specific-values/m-p/1339260#M8598</guid>
      <dc:creator>JimMiller3</dc:creator>
      <dc:date>2023-10-18T18:13:19Z</dc:date>
    </item>
  </channel>
</rss>

