<?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: A script for advance label expression in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318885#M4337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I suppose the easiest way will be to create additional Label Class (in Label Manager) and apply SQL Query to chose only those record with empty [Species_Name] field and then use label expression with only first part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Default Label Class should have SQL Query specified to select only those record with [Species_Name] not empty.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Sep 2012 11:05:34 GMT</pubDate>
    <dc:creator>MarcinGasior</dc:creator>
    <dc:date>2012-09-25T11:05:34Z</dc:date>
    <item>
      <title>A script for advance label expression</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318880#M4332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I was wondering if anyone can help with a specific script for labelling the below. I am totally new to VBscript so any help will be greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are two fields: [Animal] &amp;amp; [Species_Name]. E.g.: [Animal] = Frog, [Species_Name] = Rana catesbeiana Shaw, 1802&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How could I make the label appear like this below?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 4;"&gt;Frog&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Rana catesbiana&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shaw,1802&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically the font size for the frog is set and bold, and the second field is text wrapped after the second spacing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank u in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 07:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318880#M4332</guid>
      <dc:creator>SiyangTeo</dc:creator>
      <dc:date>2012-09-24T07:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: A script for advance label expression</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318881#M4333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try the following code in Label Expression with Advanced marked:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Function FindLabel ( [Animal], [Species_Name] )
&amp;nbsp; FindLabel = "&amp;lt;BOL&amp;gt;&amp;lt;FNT name='Arial' size='12'&amp;gt;" &amp;amp; [Animal] &amp;amp; "&amp;lt;/FNT&amp;gt;&amp;lt;/BOL&amp;gt;" &amp;amp; _
&amp;nbsp; "&amp;lt;FNT name='Arial' size='10'&amp;gt;" &amp;amp; vbnewline &amp;amp; _ 
&amp;nbsp; Split( [Species_Name]) (0) &amp;amp; " " &amp;amp; Split( [Species_Name] )(1) &amp;amp; _ 
&amp;nbsp; vbnewline &amp;amp; _
&amp;nbsp; Split( [Species_Name] )(2) &amp;amp; " " &amp;amp; Split( [Species_Name] )(3) &amp;amp; "&amp;lt;/FNT&amp;gt;"
End Function&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This code, after setting Left Horizontal Alignment in Symbol properties, gives me this result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]17913[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can read more about advanced labeling and formatting tags &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Building_label_expressions/00s800000027000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:09:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318881#M4333</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-11T15:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: A script for advance label expression</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318882#M4334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's really useful! I think I can decipher most of what you wrote there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, my field [Species_Name] contains a few differing names, some with 2 spaces, 3 spaces and so on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, three of the [Species_Name] are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cassia fistula L.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrographis paniculata (Burm. f.) Wall. ex Nees&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fittonia albivensis (Lindl. ex hort. Veitch)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;They will not show up in the labels since the expression did not specify the number of spaces. How do edit your code so that only the first two characters are at the first line while the remainder in the second?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Specifically, how do I make them like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 3;"&gt;Frog&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Cassia fistula&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;L.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 3;"&gt;Frog&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrographis paniculata &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Burm. f.) Wall. ex Nees&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 3;"&gt;Frog&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Fittonia albivensis &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Lindl. ex hort. Veitch)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks once again for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 14:34:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318882#M4334</guid>
      <dc:creator>SiyangTeo</dc:creator>
      <dc:date>2012-09-24T14:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: A script for advance label expression</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318883#M4335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In this case the following script should do the work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Function FindLabel ( [Animal], [Species_Name] ) &amp;nbsp; Dim SpNameArray &amp;nbsp; SpNameArray = Split([Species_Name]) &amp;nbsp; Dim Authors &amp;nbsp; Authors = "" &amp;nbsp; For i=2 to UBound(SpNameArray) &amp;nbsp;&amp;nbsp;&amp;nbsp; Authors = Authors &amp;amp; SpNameArray(i) &amp;amp; " "&amp;nbsp; &amp;nbsp; Next &amp;nbsp; FindLabel = "&amp;lt;BOL&amp;gt;&amp;lt;FNT name='Arial' size='12'&amp;gt;" &amp;amp; [Animal] &amp;amp; "&amp;lt;/FNT&amp;gt;&amp;lt;/BOL&amp;gt;" &amp;amp; _ &amp;nbsp; "&amp;lt;FNT name='Arial' size='10'&amp;gt;&amp;lt;ITA&amp;gt;" &amp;amp; vbnewline &amp;amp; _&amp;nbsp; &amp;nbsp; Split( [Species_Name]) (0) &amp;amp; " " &amp;amp; Split( [Species_Name] )(1) &amp;amp; "&amp;lt;/ITA&amp;gt;" &amp;amp; _&amp;nbsp; &amp;nbsp; vbnewline &amp;amp; Authors &amp;amp; "&amp;lt;/FNT&amp;gt;" End Function&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]17952[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This script puts two first words from [Species_Name] in one line and the rest words from this field in second line.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 08:36:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318883#M4335</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-09-25T08:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: A script for advance label expression</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318884#M4336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks! I'm learning quite a lot of vbscript through your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually I found that this function of yours earlier works best for me, since the authorship of the species is redundant for my purpose. I modified slightly to become this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Function FindLabel ( [Animal] , [Species_Name] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; FindLabel = "&amp;lt;BOL&amp;gt;&amp;lt;FNT name='Arial' size='12'&amp;gt;" &amp;amp; [Animal] &amp;amp; "&amp;lt;/FNT&amp;gt;&amp;lt;/BOL&amp;gt;" &amp;amp; _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "&amp;lt;FNT name='Arial' size='10'&amp;gt;" &amp;amp; vbnewline &amp;amp;_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Split ( [Species_Name] ) (0) &amp;amp; " " &amp;amp; Split ( [Species_Name] ) (1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 3;"&gt;Frog&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Rana catesbiana&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shaw,1802&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will become this instead:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 3;"&gt;Frog&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Rana catesbiana&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I encountered another problem. I found out that when a species names [Species_Name] is not listed, the entire point for it will not be labelled at all. How can I modify this code so that when such a case happen, the label will show only the [Animal] field? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For this case, it means that only &lt;/SPAN&gt;&lt;STRONG style="font-size: 3;"&gt;Frog&lt;/STRONG&gt;&lt;SPAN&gt; will be shown when it has no species name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 10:40:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318884#M4336</guid>
      <dc:creator>SiyangTeo</dc:creator>
      <dc:date>2012-09-25T10:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: A script for advance label expression</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318885#M4337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I suppose the easiest way will be to create additional Label Class (in Label Manager) and apply SQL Query to chose only those record with empty [Species_Name] field and then use label expression with only first part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Default Label Class should have SQL Query specified to select only those record with [Species_Name] not empty.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 11:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318885#M4337</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-09-25T11:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: A script for advance label expression</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318886#M4338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks! It works now~ &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Appreciate the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 13:33:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/a-script-for-advance-label-expression/m-p/318886#M4338</guid>
      <dc:creator>SiyangTeo</dc:creator>
      <dc:date>2012-09-25T13:33:04Z</dc:date>
    </item>
  </channel>
</rss>

