<?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: Labels do not appear in ArcGIS Online in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709228#M54972</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I have tried it - still no luck &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Oct 2018 23:18:21 GMT</pubDate>
    <dc:creator>DmitryShatilov</dc:creator>
    <dc:date>2018-10-02T23:18:21Z</dc:date>
    <item>
      <title>Labels do not appear in ArcGIS Online</title>
      <link>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709226#M54970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I am trying to assign labels to feature layer using advance python labeling.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;The label are fetching from feature layer related table using following python script logic, which is given at ESRI Tech Support&amp;nbsp;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsupport.esri.com%2Fen%2Ftechnical-article%2F000012230" style="color: #287433; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;How To: Label a related table&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel ([keyField], [FirstLabel]):
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy

&amp;nbsp;&amp;nbsp;&amp;nbsp; key1 = [keyField] # Key field in feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp; key2 = "ID"&amp;nbsp;&amp;nbsp; # Key field in related table
&amp;nbsp;&amp;nbsp;&amp;nbsp; L = [FirstLabel] # Label field in feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp; L2 = "Label2"&amp;nbsp;&amp;nbsp; # Label field in related table
&amp;nbsp;&amp;nbsp;&amp;nbsp; myDataTable = r"&amp;lt;path-to-related-table&amp;gt;"&amp;nbsp;&amp;nbsp; # Path to related table
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; cur = arcpy.da.SearchCursor(myDataTable, [key2, L2])
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if str(key1) == str(row[0]): 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L = L + " " + str(row[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp; return L&lt;/PRE&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px;"&gt;I can see the labels in ArcMap or in the preview before I publish it as a web service, but cannot see them in ArcGIS Online. I suspect there might be a problem with the path I use in the label expression.&lt;/P&gt;&lt;P style="border: 0px;"&gt;It looks something like this: r"Database Connections\TEST.sde\Related_Table". Am I missing something?&lt;/P&gt;&lt;P style="border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px;"&gt;Also, I have created a brand new geodatabe, where I put a feature class and a related table I want to get the labels from. In this case my paths looks like that - r"C:\Test.gdb\Related_Table". Again, it works fine in ArcMap, but there are no labels after I have published it as a web service?&lt;/P&gt;&lt;P style="border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px;"&gt;Please, help!&lt;/P&gt;&lt;P style="border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px;"&gt;Thanks heaps in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709226#M54970</guid>
      <dc:creator>DmitryShatilov</dc:creator>
      <dc:date>2021-12-12T05:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Labels do not appear in ArcGIS Online</title>
      <link>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709227#M54971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dmitry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you may be right on the data path. From what I recall, "\t" in python acts as a tab (not sure of "\T" would though, like you have in your path). Maybe you could try forward slashes instead of backslashes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 23:05:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709227#M54971</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2018-10-02T23:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Labels do not appear in ArcGIS Online</title>
      <link>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709228#M54972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I have tried it - still no luck &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 23:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709228#M54972</guid>
      <dc:creator>DmitryShatilov</dc:creator>
      <dc:date>2018-10-02T23:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Labels do not appear in ArcGIS Online</title>
      <link>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709229#M54973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I think the issue is AGOL. Labeling is quite limited in AGOL and when just publishing a feature class, you can only see so many labels. Publishing a map service (through ArcGIS Enterprise) will allow more advanced label functionality.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maplex Label engine is support in map services:&lt;/P&gt;&lt;P&gt;&lt;A class="jivelink10" href="http://enterprise.arcgis.com/en/server/latest/publish-services/linux/supported-functionality-in-map-services.htm#GUID-4A082EAC-FC97-4CC7-86B7-DE5516369ED8" title="http://enterprise.arcgis.com/en/server/latest/publish-services/linux/supported-functionality-in-map-services.htm#GUID-4A082EAC-FC97-4CC7-86B7-DE5516369ED8"&gt;http://enterprise.arcgis.com/en/server/latest/publish-services/linux/supported-functionality-in-map-services.htm#GUID-4A082EAC-FC97-4CC7-86B7-DE5516369ED8&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-text/working-with-the-standard-label-engine.htm" style="color: #0074b8; background-color: #ffffff; text-decoration: none;"&gt;Standard Label Engine&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is available, as well as annotation. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-text/working-with-the-maplex-labeling-engine.htm" style="color: #0074b8; background-color: #ffffff; text-decoration: none;"&gt;Maplex Label Engine&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is available but is recommended for cached maps only.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4c4c4c; background-color: #ffffff;"&gt;VBScript-based label expressions are not supported on&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;ArcGIS Server&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(Linux). JavaScript and Python-based label expressions are supported.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For Feature Service, first be sure you have labels turned on and take a look at this article on labeling:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/arcgis-online/create-maps/create-labels.htm" title="https://doc.arcgis.com/en/arcgis-online/create-maps/create-labels.htm"&gt;Create labels—ArcGIS Online Help | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, likely you will have to explore custom labels with ArcGIS Arcade:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/using-arcade-expressions-in-web-apps/" title="https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/using-arcade-expressions-in-web-apps/"&gt;Using Arcade expressions in web apps&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an old blog post that mentions another approach at custom labels but not sure this is still applicable.:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/adding-labels-to-arcgis-online-web-maps-part-1/" title="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/adding-labels-to-arcgis-online-web-maps-part-1/"&gt;Adding labels to ArcGIS Online web maps: Part 1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 23:38:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/labels-do-not-appear-in-arcgis-online/m-p/709229#M54973</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2018-10-02T23:38:37Z</dc:date>
    </item>
  </channel>
</rss>

