<?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 table advanced formatting in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/dashboard-table-advanced-formatting/m-p/1310440#M6681</link>
    <description>&lt;P&gt;There are two issues with your code. First, the arguments in &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#find" target="_self"&gt;Find&lt;/A&gt; function are reversed. Second, the backgroundColor property needs to be a color code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gpm = $datapoint["mystringfield"];
var bgColor;
if (Find(",", gpm) &amp;gt; -1) bgColor = "#ff0000";

//
gpm: {
  displayText: $datapoint["mystringfield"],
  textColor: '',
  backgroundColor: bgColor,
  textAlign: 'left',
  iconName: '',
  iconAlign: '',
  iconColor: '',
  iconOutlineColor: ''
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jul 2023 13:28:58 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2023-07-21T13:28:58Z</dc:date>
    <item>
      <title>Dashboard table advanced formatting</title>
      <link>https://community.esri.com/t5/developers-questions/dashboard-table-advanced-formatting/m-p/1310431#M6680</link>
      <description>&lt;P&gt;Looking for an example of how to apply the advanced formatting of a Dashboard list that evaluates a string field for a comma. IF the comma exists then I need to return the background cell as red.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to get formatting working to evaluate date fields for how many days out from today but I can't seem to get anything working for my comma example. This is what I came up with based on what has worked for me in the past but the table does not get formatted and stays in the original formatting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var gpm = $datapoint["mystringfield"];&lt;BR /&gt;var hasComma = Find(mystringfield, ",");&lt;BR /&gt;var isGreaterThanMinusOne = hasComma &amp;gt; -1,"#D94534";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;return {&lt;BR /&gt;cells: {&lt;BR /&gt;number: {&lt;BR /&gt;displayText: $datapoint["number"],&lt;BR /&gt;textColor: '',&lt;BR /&gt;backgroundColor: '',&lt;BR /&gt;textAlign: 'left',&lt;BR /&gt;iconName: '',&lt;BR /&gt;iconAlign: '',&lt;BR /&gt;iconColor: '',&lt;BR /&gt;iconOutlineColor: ''&lt;BR /&gt;},&lt;BR /&gt;gpm: {&lt;BR /&gt;displayText: $datapoint["mystringfield"],&lt;BR /&gt;textColor: '',&lt;BR /&gt;backgroundColor: isGreaterThanMinusOne,&lt;BR /&gt;textAlign: 'left',&lt;BR /&gt;iconName: '',&lt;BR /&gt;iconAlign: '',&lt;BR /&gt;iconColor: '',&lt;BR /&gt;iconOutlineColor: ''&lt;BR /&gt;},&lt;BR /&gt;creationdate: {&lt;BR /&gt;displayText: $datapoint["datefield"],&lt;BR /&gt;textColor: '',&lt;BR /&gt;backgroundColor: '',&lt;BR /&gt;textAlign: 'left',&lt;BR /&gt;iconName: '',&lt;BR /&gt;iconAlign: '',&lt;BR /&gt;iconColor: '',&lt;BR /&gt;iconOutlineColor: ''&lt;BR /&gt;},&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 13:24:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/dashboard-table-advanced-formatting/m-p/1310431#M6680</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2023-07-21T13:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard table advanced formatting</title>
      <link>https://community.esri.com/t5/developers-questions/dashboard-table-advanced-formatting/m-p/1310440#M6681</link>
      <description>&lt;P&gt;There are two issues with your code. First, the arguments in &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#find" target="_self"&gt;Find&lt;/A&gt; function are reversed. Second, the backgroundColor property needs to be a color code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gpm = $datapoint["mystringfield"];
var bgColor;
if (Find(",", gpm) &amp;gt; -1) bgColor = "#ff0000";

//
gpm: {
  displayText: $datapoint["mystringfield"],
  textColor: '',
  backgroundColor: bgColor,
  textAlign: 'left',
  iconName: '',
  iconAlign: '',
  iconColor: '',
  iconOutlineColor: ''
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 13:28:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/dashboard-table-advanced-formatting/m-p/1310440#M6681</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-07-21T13:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard table advanced formatting</title>
      <link>https://community.esri.com/t5/developers-questions/dashboard-table-advanced-formatting/m-p/1310462#M6682</link>
      <description>&lt;P&gt;Yes! Thank you KenBuja, this is what I needed. I struggle with the syntax and formatting for if statements. Thank for advancing my knowledge of Arcade formatting, I appreciate it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 13:42:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/dashboard-table-advanced-formatting/m-p/1310462#M6682</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2023-07-21T13:42:05Z</dc:date>
    </item>
  </channel>
</rss>

