<?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: update the html in 'custom attribute display' programatically using rest api python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707301#M37</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The 'layers' property of 'WebMap' objects is something that is available in version 1.3 and above. Can you upgrade your conda package and try?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At version 1.3, when you add a layer to your web map by calling 'add_layer()' method, it automatically builds a default pop-up. You can customize it further by removing certain attributes that you do not want to display.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Dec 2017 18:45:57 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2017-12-21T18:45:57Z</dc:date>
    <item>
      <title>update the html in 'custom attribute display' programatically using rest api python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707300#M36</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to loop each web map in ArcGIS online/portal and update the html for layers with&amp;nbsp; 'custom attribute display'.&lt;/P&gt;&lt;P&gt;I am unable to get layers from web map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;from IPython.display import display&lt;BR /&gt;import arcgis&lt;BR /&gt;from arcgis.gis import GIS&lt;/DIV&gt;&lt;DIV&gt;# connect to your GIS&lt;BR /&gt;&lt;SPAN&gt;gis = GIS("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com" rel="nofollow" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;","arcgis_python","P@ssword123")&lt;/SPAN&gt;&lt;BR /&gt;webmap_search = gis.content.search("Ebola maps", item_type="Web Map")&lt;BR /&gt;ebola_map_item = webmap_search[1]&lt;BR /&gt;ebola_map = WebMap(ebola_map_item)&lt;BR /&gt;for layer in&lt;STRONG&gt; ebola_map.layers&lt;/STRONG&gt;: --- error:&amp;nbsp;&lt;PRE style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 14px; display: block; padding: 0px; margin: 0px; line-height: inherit; word-break: break-all; word-wrap: break-word; color: #000000; background-color: #ffffff; border: 0px; border-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;'WebMap' object has no attribute 'layers'&lt;/PRE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(layer.title)&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Is there any possibilities of updating HTML programmatically for all the layers in webmaps in Group.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2017 07:44:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707300#M36</guid>
      <dc:creator>PareshPatel2</dc:creator>
      <dc:date>2017-12-21T07:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: update the html in 'custom attribute display' programatically using rest api python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707301#M37</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The 'layers' property of 'WebMap' objects is something that is available in version 1.3 and above. Can you upgrade your conda package and try?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At version 1.3, when you add a layer to your web map by calling 'add_layer()' method, it automatically builds a default pop-up. You can customize it further by removing certain attributes that you do not want to display.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2017 18:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707301#M37</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-12-21T18:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: update the html in 'custom attribute display' programatically using rest api python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707302#M38</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that possible for update default pop-up programmatically&lt;SPAN style="background-color: #ffffff;"&gt;?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Basically our idea is, we are retrieving list of service layers fields information and generating our own html table for configure pop - up when creating web map with the respective services.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2017 16:42:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707302#M38</guid>
      <dc:creator>PareshPatel2</dc:creator>
      <dc:date>2017-12-22T16:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: update the html in 'custom attribute display' programatically using rest api python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707303#M39</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At the current version (1.3) the API the pop-up functionality is limited to giving you a basic pop-up that displays all the fields in a table.&lt;/P&gt;&lt;P&gt;But, if you know what needs to be put in the pup-up object, you can easily change the values and call the `update()` method. Since you are doing this on multiple web maps, I would recommend doing one using the web map UX (or ArcGIS Pro), read that maps definition (call the WebMap.definition or WebMap.layers property) to find the pop-up object and replicate that logic in all your maps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2017 18:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707303#M39</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-12-22T18:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: update the html in 'custom attribute display' programatically using rest api python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707304#M40</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Mani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to get the current configure popupinfo using below code, but when I tried to update it back, it's not reflecting.&lt;/P&gt;&lt;P&gt;I don't know where i am missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from arcgis.gis import GIS&lt;BR /&gt;from arcgis.gis import *&lt;BR /&gt;from arcgis.mapping import WebMap, WebScene&lt;/P&gt;&lt;P&gt;ago_gis = GIS(pPrtl_URL , pUserName , PPswrd) // Connecting Portal&lt;BR /&gt;search_Results = ago_gis.content.search('title:Test_html',item_type='Web Map', max_items=1000, outside_org=False) // Search Web Map&lt;BR /&gt;wm = search_Results[0]&lt;BR /&gt;web_map_obj = WebMap(wm)&lt;BR /&gt;lyrsdct = web_map_obj.layers[0]&lt;BR /&gt;lyrobj = lyrsdct['layers'][0]&lt;BR /&gt;popinfoObj = lyrobj['popupInfo']&lt;BR /&gt;popinfoObj['description'] // Able to display existing configured popinfoObj&lt;/P&gt;&lt;P&gt;// I am assing html table&lt;BR /&gt;popinfoObj['description'] = """ &amp;lt;table style="width:100%"&amp;gt;&lt;BR /&gt;&amp;lt;tbody&amp;gt;&lt;BR /&gt;&amp;lt;tr&amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;&lt;BR /&gt; &amp;lt;b&amp;gt;&lt;BR /&gt; &amp;lt;u&amp;gt;B&amp;lt;/u&amp;gt;&lt;BR /&gt; &amp;lt;/b&amp;gt;&lt;BR /&gt; &amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;tr style="background-color: #e9e9e9"&amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;SUBBASIN&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;{SUBBASIN }&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;tr &amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;CGIA_FMS&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;{CGIA_FMS }&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;tr style="background-color: #e9e9e9"&amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;DWQ_INDEX_&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;{DWQ_INDEX_ }&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;tr &amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;DWQ_CLASS&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;td&amp;gt;{DWQ_CLASS }&amp;lt;/td&amp;gt;&lt;BR /&gt; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;/tbody&amp;gt;&lt;BR /&gt;&amp;lt;/table&amp;gt; """&lt;BR /&gt;web_map_obj.update // updating map object&lt;BR /&gt;wm.update // updating web map&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 11:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707304#M40</guid>
      <dc:creator>PareshPatel2</dc:creator>
      <dc:date>2017-12-27T11:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: update the html in 'custom attribute display' programatically using rest api python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707305#M41</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/144496"&gt;Paresh Patel&lt;/A&gt;, you'll have to edit the web map object dictionary directly with the new HTML code, as opposed to editing the children dictionaries&amp;nbsp;that are created as copies in your&amp;nbsp;script.&amp;nbsp; In version 1.2.3, index into the appropriate list item/dictionary value and set the description key equal to your html code, then call the web_map_object.update() method, which will send the update to the server.&amp;nbsp; In version 1.3, obtain the definition dictionary of the web map object and edit accordingly, then pass the dictionary in to the web_map_object.update() method.&amp;nbsp; Refer to the scripts below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With version 1.2.3 of the ArcGIS API for Python:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from arcgis.gis import GIS&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;from arcgis.mapping import WebMap&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;gis = GIS("&amp;lt;org_url&amp;gt;", "username", "password")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;search = gis.content.search('title:Test_html')&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;wm = search[0]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;wmo = WebMap(wm)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;updated_html = "&amp;lt;updated html string&amp;gt;"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;wmo['operationalLayers'][0]['layers'][0]['popupInfo']['description'] = updated_html&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;wmo.update()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With version 1.3&amp;nbsp;of the ArcGIS API for Python:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from arcgis.gis import GIS&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;from arcgis.mapping import WebMap&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;gis = GIS("&amp;lt;org_url&amp;gt;", "username", "password")&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;search = gis.content.search('title:Test_html')&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;wm = search[0]&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;wmo = WebMap(wm)&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;updated_html = "&amp;lt;updated html string&amp;gt;"&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;# get the definition dictionary of the web map object&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;def_dict = wmo.definition&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;# index into the appropriate layer and assign the update html as the popup&amp;nbsp;&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;def_dict['operationalLayers'][0]['layers'][0]['popupInfo']['description'] = updated_html&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;# pass the updated definition dictionary into the web map object update method, boolean is returned&lt;/EM&gt;&lt;BR clear="none" /&gt;&lt;EM&gt;wmo.update(def_dict)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:48:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-the-html-in-custom-attribute-display/m-p/707305#M41</guid>
      <dc:creator>TylerHays</dc:creator>
      <dc:date>2018-01-04T18:48:40Z</dc:date>
    </item>
  </channel>
</rss>

