<?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 Autolabel Feature Class Using a Relate in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/autolabel-feature-class-using-a-relate/m-p/263694#M24437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a feature class called FC1. I also have a Table called TBL1. The feature class and table are related using a 1-M relationship.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is as follows. Is there any way using ArcGIS Server 10.2.2 and ESRI JS to auto label my FC1 using all the related attributes from TBL1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Feature Class: Kennel&lt;/P&gt;&lt;P&gt;Table: Dog&lt;/P&gt;&lt;P&gt;Relationship: KennelDogs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to have my kennels displayed on the map and autolabel each kennel with the dog's name. So the symbol for kennel 1 would have beside it DogName1, DogName2. Kennel 2 would have DogName3, DogName4, and DogName5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 04:20:25 GMT</pubDate>
    <dc:creator>AlexeiB</dc:creator>
    <dc:date>2014-08-20T04:20:25Z</dc:date>
    <item>
      <title>Autolabel Feature Class Using a Relate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/autolabel-feature-class-using-a-relate/m-p/263694#M24437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a feature class called FC1. I also have a Table called TBL1. The feature class and table are related using a 1-M relationship.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is as follows. Is there any way using ArcGIS Server 10.2.2 and ESRI JS to auto label my FC1 using all the related attributes from TBL1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Feature Class: Kennel&lt;/P&gt;&lt;P&gt;Table: Dog&lt;/P&gt;&lt;P&gt;Relationship: KennelDogs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to have my kennels displayed on the map and autolabel each kennel with the dog's name. So the symbol for kennel 1 would have beside it DogName1, DogName2. Kennel 2 would have DogName3, DogName4, and DogName5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 04:20:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/autolabel-feature-class-using-a-relate/m-p/263694#M24437</guid>
      <dc:creator>AlexeiB</dc:creator>
      <dc:date>2014-08-20T04:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Autolabel Feature Class Using a Relate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/autolabel-feature-class-using-a-relate/m-p/263695#M24438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try below option, this option does not use relationship class, but labels a layer based on another feature class with 1:M relation. &lt;STRONG&gt;I have not tested this with publishing the layer to ArcGIS Server&lt;/STRONG&gt;. I would expect it to work with ArcGIS Server as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/3652_Untitled.png" style="width: 620px; height: 496px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the expression code used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14085178284109868" jivemacro_uid="_14085178284109868"&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;def FindLabel ( [ROUTE_LINK_NO]&amp;nbsp; ):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; relateTable = r"C:\tempdelete\PL_TO_LINE.gdb\PL\VERT_TO_POINIT"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; returnFieldName = "POINT_M"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; joinFieldName = "ROUTE_LINK_NO"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; label = ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp; with arcpy.da.SearchCursor(relateTable, (returnFieldName), joinFieldName + " = " + [ROUTE_LINK_NO] ) as cursor:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = label + str(row[0]) + ","&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return label&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 06:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/autolabel-feature-class-using-a-relate/m-p/263695#M24438</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-08-20T06:58:30Z</dc:date>
    </item>
  </channel>
</rss>

