<?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: Assign text color from attribute value in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/assign-text-color-from-attribute-value/m-p/1415795#M9502</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;thank you!!&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2024 12:22:12 GMT</pubDate>
    <dc:creator>dwold</dc:creator>
    <dc:date>2024-04-26T12:22:12Z</dc:date>
    <item>
      <title>Assign text color from attribute value</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/assign-text-color-from-attribute-value/m-p/1415507#M9498</link>
      <description>&lt;P&gt;I am trying color text based on the name of an attribute.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;I tried following this &lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/changing-colors-in-a-list-based-on-survey-answer/td-p/1149698" target="_self"&gt;post&lt;/A&gt; you did but the issue I am having is it is 1. assigning colors to the entire row and 2. not assigning the color to the event type I want (line 2). Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var c = $datapoint['event_type']

if(c == 'Exercise'){
    return {textColor:'#FDFF6D'}
} else if(c == 'Training'){
    return {textColor:'#FB1C53'}
} else if(c == 'Event Activation'){
    return {textColor:'#0F78B9'}
} else {
    return {textcolor:'#7CC88A'}
}

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'#adadad',
  selectionColor: '#fcfc86',
  selectionTextColor: '#fcfc86',
   attributes: {
     attribute1: c
   }
}&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="dwold_1-1714071994269.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102189iE851CB5859A237B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dwold_1-1714071994269.png" alt="dwold_1-1714071994269.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{field/event_name} {field/event_type}&lt;/P&gt;&lt;P&gt;{expression/attribute1}&lt;/P&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="dwold_0-1714071896124.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102187i0E12B4CF5AE69021/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dwold_0-1714071896124.png" alt="dwold_0-1714071896124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I also tried this with no success...&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var eventType = $datapoint.event_type;

var textColor;
if (eventType == 'Exercise') {
    textColor = '#ADFF8C';
} else if (eventType == 'Training') {
    textColor = '#FFC379';
} else if (eventType == 'Event Activation') {
    textColor = '#71C1FD';
} else {
    textColor = '#FD7F7F';
}

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'#adadad',
  selectionColor: '#fcfc86',
  selectionTextColor: '#fcfc86',
   attributes: {
     attribute1: textColor
   }
}&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="dwold_0-1714075975614.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102199i6682B796F98465AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dwold_0-1714075975614.png" alt="dwold_0-1714075975614.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 20:13:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/assign-text-color-from-attribute-value/m-p/1415507#M9498</guid>
      <dc:creator>dwold</dc:creator>
      <dc:date>2024-04-25T20:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Assign text color from attribute value</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/assign-text-color-from-attribute-value/m-p/1415639#M9499</link>
      <description>&lt;P&gt;In the line item template, you need to switch it to &lt;EM&gt;source&lt;/EM&gt;, where you see the raw HTML, then put something like '&amp;lt;span style="color:{expression/attribute1}"&amp;gt;{event_name} {event_type}&amp;lt;/span&amp;gt;'.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 23:00:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/assign-text-color-from-attribute-value/m-p/1415639#M9499</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-04-25T23:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Assign text color from attribute value</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/assign-text-color-from-attribute-value/m-p/1415795#M9502</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;thank you!!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 12:22:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/assign-text-color-from-attribute-value/m-p/1415795#M9502</guid>
      <dc:creator>dwold</dc:creator>
      <dc:date>2024-04-26T12:22:12Z</dc:date>
    </item>
  </channel>
</rss>

