<?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 Label expression depends on other field attributes condition in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604462#M4080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;I am looking to create a label expression that will result in the following: display 'Enabled', however if 'Enabled' is "False", display 'Status' label as "ALERT" &lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/246806_pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;Somethings like as below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/246807_pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Oct 2016 18:59:59 GMT</pubDate>
    <dc:creator>UludağElektrik</dc:creator>
    <dc:date>2016-10-17T18:59:59Z</dc:date>
    <item>
      <title>Label expression depends on other field attributes condition</title>
      <link>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604462#M4080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;I am looking to create a label expression that will result in the following: display 'Enabled', however if 'Enabled' is "False", display 'Status' label as "ALERT" &lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/246806_pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;Somethings like as below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/246807_pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 18:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604462#M4080</guid>
      <dc:creator>UludağElektrik</dc:creator>
      <dc:date>2016-10-17T18:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Label expression depends on other field attributes condition</title>
      <link>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604463#M4081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only one field is necessary?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vbscript&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Function FindLabel ( [Enabled] )

if [Enabled] = "False" then
&amp;nbsp; FindLabel = "ALERT"
else
&amp;nbsp; FindLabel = "Enabled"
end if

End Function&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;or&lt;/P&gt;&lt;P&gt;Python&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; FindLabel &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Enabled&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Enabled&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'False'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALERT"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Enabled"&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:55:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604463#M4081</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2021-12-12T01:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Label expression depends on other field attributes condition</title>
      <link>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604464#M4082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Ted, i really thank you. In fact you right i totally forgot, so yes i need also second one because when i applied that script on my map screen showing like as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So is there any way&amp;nbsp;to just show if "Enabled" field is 'False' and when "Status" field is 'Normal' retention for 'Enabled' label. I do not want to show that Enabled label on the map because everything is allright.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/247987_pastedImage_1.png" /&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/247994_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 15:50:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604464#M4082</guid>
      <dc:creator>UludağElektrik</dc:creator>
      <dc:date>2016-10-19T15:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Label expression depends on other field attributes condition</title>
      <link>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604465#M4083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it through code, like Ted mentions (return "" if you don't want a label), or set an SQL query to filter the features you want labelled.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/248015_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 16:18:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604465#M4083</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-10-19T16:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Label expression depends on other field attributes condition</title>
      <link>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604466#M4084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like &lt;A href="https://community.esri.com/migrated-users/19932"&gt;Darren Wiens&lt;/A&gt;&amp;nbsp; mentioned filtering or modify my script above to return a blank string for the label (this happens when enabled is true -- actually it would happen if enabled is anything else except false)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vbscript&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;FindLabel = ""&lt;/P&gt;&lt;P&gt;---------------------------------&lt;/P&gt;&lt;P&gt;Python&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ""&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:25:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604466#M4084</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2016-10-19T17:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Label expression depends on other field attributes condition</title>
      <link>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604467#M4085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for every contributors&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 18:11:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/label-expression-depends-on-other-field-attributes/m-p/604467#M4085</guid>
      <dc:creator>UludağElektrik</dc:creator>
      <dc:date>2016-10-19T18:11:14Z</dc:date>
    </item>
  </channel>
</rss>

