<?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 Combine multiple values  to color values using expressions in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/combine-multiple-values-to-color-values-using/m-p/1083651#M4859</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have a category field that I want to display on a dashboard list with different background colors (div) for each category.&amp;nbsp; For example: I have a field called “Project_status” and the categories are:&lt;/P&gt;&lt;P&gt;1.Completed,&lt;/P&gt;&lt;P&gt;2.Proposed,&lt;/P&gt;&lt;P&gt;3.In-progress,&lt;/P&gt;&lt;P&gt;4.Under-Review,&lt;/P&gt;&lt;P&gt;5.Funded,&lt;/P&gt;&lt;P&gt;6.Canceled,&lt;/P&gt;&lt;P&gt;7.Incomplete,&lt;/P&gt;&lt;P&gt;8. Extended,&amp;nbsp;&lt;/P&gt;&lt;P&gt;9.Approved. &amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to accomplish is to color “Completed”, “Canceled” and “Incomplete” with a GREEN background color, “In-progress” and “Under-Review” as ORANGE and else as GRAY background color.&amp;nbsp; I don’t want to create a new field just to combine the categories and I’m trying to build an expression to combine the values. &amp;nbsp;I was able to create an expression ( I'm just learning)&amp;nbsp; for coding a color for each category but I’m not sure how to ‘group” multiple categories to assign the same color code. Below is a sample of the expression I created. (I also created a HTML style using &amp;lt;div style="background-color: {expression/ backCardColor} &amp;lt;/div&amp;gt; to assign the background color.) .&amp;nbsp; &amp;nbsp;If you have any suggestions, please let me know. Thanks !&lt;/P&gt;&lt;P&gt;********************************************************&lt;/P&gt;&lt;P&gt;Var prjStatus= $datapoint[&lt;FONT color="#FF0000"&gt;"Project_Status"&lt;/FONT&gt;];&lt;/P&gt;&lt;P&gt;if (prjStatus == &lt;FONT color="#FF0000"&gt;'Under-Review'&lt;/FONT&gt;) { &amp;nbsp;&lt;FONT color="#999999"&gt;//... I need to add “In-progress” to have the same color.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;return {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; backgroundColor: '',&lt;/P&gt;&lt;P&gt;&amp;nbsp; selectionTextColor: 'da687b',&lt;/P&gt;&lt;P&gt;&amp;nbsp; attributes: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;backCardColor:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;'#f6deb1'&lt;/FONT&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else (prjStatus == &lt;FONT color="#FF0000"&gt;'Completed'&lt;/FONT&gt;) { &amp;nbsp;&amp;nbsp;&lt;FONT color="#999999"&gt;&amp;nbsp;// I need to add “Canceled” and “Incomplete” to have the same color…&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;return {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; backgroundColor: '',&lt;/P&gt;&lt;P&gt;&amp;nbsp; selectionTextColor: 'da687b',&lt;/P&gt;&lt;P&gt;&amp;nbsp; attributes: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;backCardColor:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;'#dee7d5'&lt;/FONT&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; backgroundColor: '',&lt;/P&gt;&lt;P&gt;&amp;nbsp; selectionTextColor: 'da687b',&lt;/P&gt;&lt;P&gt;&amp;nbsp; attributes: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;backCardColor:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;'#dfe1e3'&lt;/FONT&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 18:18:14 GMT</pubDate>
    <dc:creator>JoseBarrios1</dc:creator>
    <dc:date>2021-07-28T18:18:14Z</dc:date>
    <item>
      <title>Combine multiple values  to color values using expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/combine-multiple-values-to-color-values-using/m-p/1083651#M4859</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have a category field that I want to display on a dashboard list with different background colors (div) for each category.&amp;nbsp; For example: I have a field called “Project_status” and the categories are:&lt;/P&gt;&lt;P&gt;1.Completed,&lt;/P&gt;&lt;P&gt;2.Proposed,&lt;/P&gt;&lt;P&gt;3.In-progress,&lt;/P&gt;&lt;P&gt;4.Under-Review,&lt;/P&gt;&lt;P&gt;5.Funded,&lt;/P&gt;&lt;P&gt;6.Canceled,&lt;/P&gt;&lt;P&gt;7.Incomplete,&lt;/P&gt;&lt;P&gt;8. Extended,&amp;nbsp;&lt;/P&gt;&lt;P&gt;9.Approved. &amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to accomplish is to color “Completed”, “Canceled” and “Incomplete” with a GREEN background color, “In-progress” and “Under-Review” as ORANGE and else as GRAY background color.&amp;nbsp; I don’t want to create a new field just to combine the categories and I’m trying to build an expression to combine the values. &amp;nbsp;I was able to create an expression ( I'm just learning)&amp;nbsp; for coding a color for each category but I’m not sure how to ‘group” multiple categories to assign the same color code. Below is a sample of the expression I created. (I also created a HTML style using &amp;lt;div style="background-color: {expression/ backCardColor} &amp;lt;/div&amp;gt; to assign the background color.) .&amp;nbsp; &amp;nbsp;If you have any suggestions, please let me know. Thanks !&lt;/P&gt;&lt;P&gt;********************************************************&lt;/P&gt;&lt;P&gt;Var prjStatus= $datapoint[&lt;FONT color="#FF0000"&gt;"Project_Status"&lt;/FONT&gt;];&lt;/P&gt;&lt;P&gt;if (prjStatus == &lt;FONT color="#FF0000"&gt;'Under-Review'&lt;/FONT&gt;) { &amp;nbsp;&lt;FONT color="#999999"&gt;//... I need to add “In-progress” to have the same color.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;return {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; backgroundColor: '',&lt;/P&gt;&lt;P&gt;&amp;nbsp; selectionTextColor: 'da687b',&lt;/P&gt;&lt;P&gt;&amp;nbsp; attributes: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;backCardColor:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;'#f6deb1'&lt;/FONT&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else (prjStatus == &lt;FONT color="#FF0000"&gt;'Completed'&lt;/FONT&gt;) { &amp;nbsp;&amp;nbsp;&lt;FONT color="#999999"&gt;&amp;nbsp;// I need to add “Canceled” and “Incomplete” to have the same color…&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;return {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; backgroundColor: '',&lt;/P&gt;&lt;P&gt;&amp;nbsp; selectionTextColor: 'da687b',&lt;/P&gt;&lt;P&gt;&amp;nbsp; attributes: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;backCardColor:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;'#dee7d5'&lt;/FONT&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; backgroundColor: '',&lt;/P&gt;&lt;P&gt;&amp;nbsp; selectionTextColor: 'da687b',&lt;/P&gt;&lt;P&gt;&amp;nbsp; attributes: {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;backCardColor:&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;'#dfe1e3'&lt;/FONT&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 18:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/combine-multiple-values-to-color-values-using/m-p/1083651#M4859</guid>
      <dc:creator>JoseBarrios1</dc:creator>
      <dc:date>2021-07-28T18:18:14Z</dc:date>
    </item>
  </channel>
</rss>

