<?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 Attribute Expressions in AGOL in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466825#M36472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently looking at/researching how to edit attribute expressions and even change the color of text in the expressions. My problem is, I do not know how to go about it or which language to use that would be best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/371601_Attribute Expression.JPG" style="width: 620px; height: 304px;" /&gt;&lt;/P&gt;&lt;P&gt;Any links to articles/discussion/resources or even solutions are welcome!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Sep 2017 19:43:24 GMT</pubDate>
    <dc:creator>VishalShah2</dc:creator>
    <dc:date>2017-09-18T19:43:24Z</dc:date>
    <item>
      <title>Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466825#M36472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently looking at/researching how to edit attribute expressions and even change the color of text in the expressions. My problem is, I do not know how to go about it or which language to use that would be best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/371601_Attribute Expression.JPG" style="width: 620px; height: 304px;" /&gt;&lt;/P&gt;&lt;P&gt;Any links to articles/discussion/resources or even solutions are welcome!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Sep 2017 19:43:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466825#M36472</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-09-18T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466826#M36473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The scripting language is called Arcade (&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/" title="https://developers.arcgis.com/arcade/"&gt;ArcGIS Arcade | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;) which is similar to JavaScript (not Python). Use a script to create new results based on multiple attributes. When using Arcade in the pop-up windows, you can get some fancy results. See also this thread:&amp;nbsp;&lt;A href="https://community.esri.com/thread/197406-insert-html-with-arcade"&gt;https://community.esri.com/thread/197406-insert-html-with-arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Sep 2017 19:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466826#M36473</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-09-18T19:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466827#M36474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know of any examples where people have tried to change the color of the expressions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Sep 2017 19:53:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466827#M36474</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-09-18T19:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466828#M36475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the documentation that I think you are looking for. It is at the very bottom talking about using If Then statements to drive font color and it gives you the arcade statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/help/mapping/text/specify-text-for-labels.htm" title="http://pro.arcgis.com/en/pro-app/help/mapping/text/specify-text-for-labels.htm"&gt;Specify text for labels—ArcGIS Pro | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Sep 2017 23:21:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466828#M36475</guid>
      <dc:creator>Greg_Mattis</dc:creator>
      <dc:date>2017-09-18T23:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466829#M36476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To show an example of what can be done, your html code for a pop-up could be like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;font&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;color&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;{expression/expr0}&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;b&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;{GRAVEDAD}&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;b&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;font&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case my field is called "GRAVEDAD" with three possible values: SOLO DAÑOS (only material damage), HERIDOS (injuries), MUERTO (diseased). If you would like to vary the color of the text, you can use an Arcade expression inside the color tag (switch to HTML view to reveal the html code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression in my case would be:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// #800080 purple&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// #ff0000 red&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// #ff8c00 orange&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; dct_grav &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SOLO DAÑOS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#ff8c00"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="string token"&gt;"HERIDO"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#ff0000"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MUERTO"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#800080"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gravedad &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GRAVEDAD&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; color &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; dct_grav&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gravedad&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;color&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; color&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This will return the color code (purple, red or orange) depending the field value GRAVEDAD, resulting in:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/371650_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/371681_pastedImage_2.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/371682_pastedImage_3.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466829#M36476</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T20:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466830#M36477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Greg! This is my first time working with Arcade and Attribute Expressions in AGOL!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:41:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466830#M36477</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-09-19T12:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466831#M36478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Xander! This is my first time working with Arcade and Attribute Expressions in AGOL!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:42:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466831#M36478</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-09-19T12:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466832#M36479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// #FAAF41 Primary Color&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; primaryColor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#FAAF41"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; networkID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NetworkID&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; color &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; primaryColor&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;networkID&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;color&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; color

&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;font color&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{expression/expr0}"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;b&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;networkID&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;b&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;font&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In line 10, I get an Unexpected identifier error. Do you know why that is?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:43:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466832#M36479</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T20:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466833#M36480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, line 10 should not be part of the Arcade expression. It is the html code that should be used in the pop-up configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the pop-up configuration, select "A custom attribute display" and hit CONFIGURE:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/371786_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then switch to HTML with the "View HTML source" button:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/371787_pastedImage_2.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and past the HTML here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 16:26:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466833#M36480</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-09-19T16:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466834#M36481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yea removing line 10 took out the error for unexpected identifier, however with this code now for Attribute Expressions, i get the execution error: runtime error: cannot call member property on object of this type. I'm fairly new to Arcade and such and do not understand these errors. Any assistance on this bit then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// #FAAF41 Primary Color&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; primaryColor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#FAAF41"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; networkID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NetworkID&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; color &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; primaryColor&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;networkID&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;color&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; color&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:43:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466834#M36481</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T20:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466835#M36482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How many colors do you have? In my example y have 3 values, hence the line:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; dct_grav &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SOLO DAÑOS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#ff8c00"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="string token"&gt;"HERIDO"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#ff0000"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MUERTO"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#800080"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When the value is "HERIDO", the text "#ff0000" is returned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case you don't have a dictionary or object, but a single string:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; primaryColor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#FAAF41"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In your case your code should be:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; primaryColor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"your networkID value"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#FAAF41"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"some other networkID value"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"#AAAAAA"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you have a single value you would not need to use Arcade and could just hard code the color in the html code, but I am sure that that is not the case for you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you provide a &amp;nbsp;list of values in the field networkID and the corresponding colors?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 19:58:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466835#M36482</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-09-19T19:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466836#M36483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So there are roughly 600 values in the NetworkID field, which is proprietary information to my company, and the color code I provided was the primary color my company uses and is associated with us. I am trying to change the text of the NetworkIDs to be the color of that color code ( #FAAF41). Right now, there is no vision as to where we are going with the attribute expressions capability of AGOL but my company wants me to get familiar with it and test it out on existing data we have to see what I can do with it and if I can get it working while the higher ups decide what they want customized. Hopefully that explanation helps a bit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 20:18:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466836#M36483</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-09-19T20:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466837#M36484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a single color, then there is no need to use Arcade to define the color of the text, since it will always be the same. If you insist on using Arcade, it would be enough to have the color hard coded in the html code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 23:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466837#M36484</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-09-19T23:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Expressions in AGOL</title>
      <link>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466838#M36485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/vshah6"&gt;vshah6&lt;/A&gt;&amp;nbsp;, in additional to what I said before, it is really a very good thing to start exploring the possibilities of Arcade. Although it is already quite powerful, Arcade will start to play a much larger role in the ArcGIS Platform. There are some big things coming as part of the ArcGIS Utility Network Management extension for Enterprise, like attribute rules.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2017 18:30:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/attribute-expressions-in-agol/m-p/466838#M36485</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-09-20T18:30:19Z</dc:date>
    </item>
  </channel>
</rss>

