<?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: Configure Popup Attributes Programmatically with ArcGIS API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872889#M4772</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is possible but there's no "popup" API for it. You can get the webmap json, then edit the popup properties in the json, then update the webmap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the webmap spec here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/web-map-specification/objects/popupInfo/" title="https://developers.arcgis.com/web-map-specification/objects/popupInfo/" rel="nofollow noopener noreferrer" target="_blank"&gt;popupInfo | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code would be something like this (this hides every field in the popup):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;import &lt;/SPAN&gt;arcgis
&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;import &lt;/SPAN&gt;json

gis = arcgis.gis.GIS(&lt;SPAN style="color: #008080;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Farcgis.com" target="_blank"&gt;https://arcgis.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #008080;"&gt;"username"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #008080;"&gt;"password"&lt;/SPAN&gt;)

item = gis.content.get(&lt;SPAN style="color: #008080;"&gt;"&amp;lt;item-id&amp;gt;"&lt;/SPAN&gt;)
item_data = item.get_data()
field_infos = item_data[&lt;SPAN style="color: #008080;"&gt;'operationalLayers'&lt;/SPAN&gt;][&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;][&lt;SPAN style="color: #008080;"&gt;'popupInfo'&lt;/SPAN&gt;][&lt;SPAN style="color: #008080;"&gt;'fieldInfos'&lt;/SPAN&gt;]
&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;field &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;field_infos:
&amp;nbsp;&amp;nbsp;&amp;nbsp; field[&lt;SPAN style="color: #008080;"&gt;"visible"&lt;/SPAN&gt;] = &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;False
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;
&lt;/SPAN&gt;item_properties = {&lt;SPAN style="color: #008080;"&gt;"text"&lt;/SPAN&gt;: json.dumps(item_data)}
item.update(&lt;SPAN style="color: #aa4926;"&gt;item_properties&lt;/SPAN&gt;=item_properties)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:55:03 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T10:55:03Z</dc:date>
    <item>
      <title>Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872887#M4770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am hoping to run a script that can hide certain fields from an ArcGIS Online web map.&amp;nbsp; In ArcGIS Online, I would accomplish this by opening a webmap, clicking the three dots of the layer I was interested in, selecting "configure pop-up" then selecting "Configure Attribute".&amp;nbsp; Finally from there I can edit the display options in the GUI shown below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this something that is currently configurable from the ArcGIS API for Python?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399297_configure.png" style="width: 620px; height: 383px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 23:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872887#M4770</guid>
      <dc:creator>NathanielEvatt</dc:creator>
      <dc:date>2018-03-19T23:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872888#M4771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see anything in here to toggle visibility.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.mapping.html#webmap" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.mapping.html#webmap"&gt;arcgis.mapping module — arcgis 1.4.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 09:31:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872888#M4771</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2018-03-20T09:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872889#M4772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is possible but there's no "popup" API for it. You can get the webmap json, then edit the popup properties in the json, then update the webmap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the webmap spec here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/web-map-specification/objects/popupInfo/" title="https://developers.arcgis.com/web-map-specification/objects/popupInfo/" rel="nofollow noopener noreferrer" target="_blank"&gt;popupInfo | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code would be something like this (this hides every field in the popup):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;import &lt;/SPAN&gt;arcgis
&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;import &lt;/SPAN&gt;json

gis = arcgis.gis.GIS(&lt;SPAN style="color: #008080;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Farcgis.com" target="_blank"&gt;https://arcgis.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #008080;"&gt;"username"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #008080;"&gt;"password"&lt;/SPAN&gt;)

item = gis.content.get(&lt;SPAN style="color: #008080;"&gt;"&amp;lt;item-id&amp;gt;"&lt;/SPAN&gt;)
item_data = item.get_data()
field_infos = item_data[&lt;SPAN style="color: #008080;"&gt;'operationalLayers'&lt;/SPAN&gt;][&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;][&lt;SPAN style="color: #008080;"&gt;'popupInfo'&lt;/SPAN&gt;][&lt;SPAN style="color: #008080;"&gt;'fieldInfos'&lt;/SPAN&gt;]
&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;field &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;field_infos:
&amp;nbsp;&amp;nbsp;&amp;nbsp; field[&lt;SPAN style="color: #008080;"&gt;"visible"&lt;/SPAN&gt;] = &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;False
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;
&lt;/SPAN&gt;item_properties = {&lt;SPAN style="color: #008080;"&gt;"text"&lt;/SPAN&gt;: json.dumps(item_data)}
item.update(&lt;SPAN style="color: #aa4926;"&gt;item_properties&lt;/SPAN&gt;=item_properties)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:55:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872889#M4772</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T10:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872890#M4773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can accomplish this&amp;nbsp;by editing the visibility property of each field. You can do something like this&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;web_map_obj &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; WebMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;wm_item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
layer_1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; web_map_obj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layers&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#turn off visibility of field 1 of layer 1&lt;/SPAN&gt;
layer_1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;popupInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fieldInfos&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;visible &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# update the web map&lt;/SPAN&gt;
web_map_obj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&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;/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 10:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872890#M4773</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T10:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872891#M4774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool, thanks very much guys&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2018 01:14:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872891#M4774</guid>
      <dc:creator>NathanielEvatt</dc:creator>
      <dc:date>2018-03-23T01:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872892#M4775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe I should start a different conversation, but our problem is that popups go away when overwriting a service from ArcGIS Pro, and we would like to automate the process of turning them back on (grr....).&lt;/P&gt;&lt;P&gt;This shows how to control which fields are displayed when the popups are turned on. Is it possible to enable popups programmatically?&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;Randy McGregor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Nov 2018 17:36:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872892#M4775</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-11-11T17:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872893#M4776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is great. Thank you. Where is this documented? This is the first I've seen of this particular functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Randy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 17:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872893#M4776</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-04-04T17:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872894#M4777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When the I have an operational layer that is a map service layer, the "layers" property for that consistently misses many layers. I have one service that has 24 layers, and only 3 are returned. I thought maybe only the visible layers were being returned, or just the group layers, but neither is the case. Just 3 random layers are returned, all the rest totally ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MapImageLayer will list all layers, but that is just the contents of the portal item associated with the map service, rather than the configured layer within the web map, which is what I wan't to get at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something I'm missing (probably)?&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;Randy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Apr 2019 16:20:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872894#M4777</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-04-13T16:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872895#M4778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding this question, does anybody know if it is possible via Python to change the order in which the pop-ups appear in the menu? You can do it via the Web Interface, but I haven't found a way to do so with Python. Anyone has ever tried?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2019 16:08:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872895#M4778</guid>
      <dc:creator>MaximeCampeau</dc:creator>
      <dc:date>2019-04-15T16:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872896#M4779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Renaud,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This boils down to how the item is defined. For a good idea, see the second note in this post: &lt;A href="https://community.esri.com/groups/arcgis-python-api/blog/2019/04/09/updating-layer-symbology-with-the-arcgis-api-for-python"&gt;https://community.esri.com/groups/arcgis-python-api/blog/2019/04/09/updating-layer-symbology-with-the-arcgis-api-for-python&lt;/A&gt;. My advice would be to create a Web Map as you want it to appear and then look at the definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Earl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2019 02:38:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872896#M4779</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2019-04-16T02:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872897#M4780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for your code,&amp;nbsp;this is&amp;nbsp;very helpful. I could make this work for normal Hosted Feature Layers.&amp;nbsp;My problem is that I couldn't make it work&amp;nbsp;for a Hosted Feature Layer View, because&amp;nbsp;&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; border-width: 0px 0px 0px 2px; border-style: initial initial initial solid; border-color: initial initial initial #cccccc; font-size: 9pt; margin: 10px 0px; padding: 0px 0px 0px 20px;"&gt;item_data = item.get_data()&lt;/PRE&gt;&lt;P&gt;returns None, so I am not able to access&amp;nbsp;'fieldInfos'&lt;/P&gt;&lt;P&gt;Is this a general issue with Hosted Feature Layer Views or is there another way how I can configure the popup of&amp;nbsp;these layers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If necessary, I can provide an example layer to reproduce the issue. I would highly appreciate&amp;nbsp;an answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas Würsch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2019 09:25:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872897#M4780</guid>
      <dc:creator>LukasWürsch</dc:creator>
      <dc:date>2019-06-05T09:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872898#M4781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the blog, this might help me do what I want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using Python API, I am creating a webmap and adding a view to it. The view has three layers, and I want to configure the sequence of fields in each layer using json files.&lt;/P&gt;&lt;P&gt;I have created 3&amp;nbsp; json files based on all layer files in the webmap. can I update properties from json file as mentioned in your blog?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt; In your&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt; &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/groups/arcgis-python-api/blog/2019/04/09/updating-layer-symbology-with-the-arcgis-api-for-python" style="background-color: transparent; color: #2989c5; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;blog&lt;/A&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt; , in the first section 'update layer symbology in a webmap', in Line 5, are you searching for a layer in a webmap? &lt;/SPAN&gt;it seems to list out feature services with the same name as the layer name in the web map. Please help!!.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2019 18:29:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872898#M4781</guid>
      <dc:creator>JulieK</dc:creator>
      <dc:date>2019-07-11T18:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872899#M4782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Earl, I was able to update the properties. 'layer_name' variable in line 5 threw me off. Searched for web map name and that worked!!&lt;/P&gt;&lt;PRE style="margin: 0.5em 0px; padding: 1em 1em 1em 3.8em; border: 0px; font-weight: 400; font-style: normal; font-size: 15px; font-family: monospace; vertical-align: baseline; outline: 0px !important; overflow: auto hidden; color: #000000; text-shadow: #ffffff 0px 1px; direction: ltr; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; overflow-wrap: normal; line-height: 1.5; tab-size: 4; hyphens: none; background: #f5f2f0; position: relative; counter-reset: linenumber 0; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2019 15:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872899#M4782</guid>
      <dc:creator>JulieK</dc:creator>
      <dc:date>2019-07-12T15:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872900#M4783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Aaron.&amp;nbsp; I'm using this on Feature Layers, and it works great&amp;nbsp;as long as the Visualization for the layer has been edited already through the UI.&amp;nbsp; For brand new just-published Feature Layers item.get_data() returns None.&amp;nbsp; Is there a way through the Python API to "touch" the Visualization and create the backing JSON before running item.get_data()?&amp;nbsp; I have over 150 layers to deal with so I don't want to have to update them all manually first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2020 15:11:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/872900#M4783</guid>
      <dc:creator>SeanSweeney</dc:creator>
      <dc:date>2020-05-22T15:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1140750#M7083</link>
      <description>&lt;P&gt;Just a heads up for saved webmaps, you are going to be able to do this easier in ArcGIS API for Python v2.0.1.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 13:50:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1140750#M7083</guid>
      <dc:creator>achapapkowski</dc:creator>
      <dc:date>2022-02-04T13:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1176421#M7420</link>
      <description>&lt;P&gt;I need to do exactly the same thing &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3576"&gt;@SeanSweeney&lt;/a&gt;. I just need to tweak the JSON for my popups, but until the JSON exists in the map...well, it doesn't exist. I just want to stuff the default popupInfo &amp;gt; fieldInfos JSON in my map JSON and then be able to access and edit it. Note: for me, get_data() returns JSON but popupInfo and fieldInfos are not included. (I can verify they aren't in the map with ArcGIS Assistant, but are created when the popups are modified in the UI.)&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 14:51:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1176421#M7420</guid>
      <dc:creator>AlderMaps</dc:creator>
      <dc:date>2022-05-23T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1176669#M7421</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3576"&gt;@SeanSweeney&lt;/a&gt;&amp;nbsp;Took all day but I think I have a method working to accomplish what we are looking to do--add the "default" popupInfo JSON to the webmap without having to configure anything in the UI ahead of time. TL;DR: have to get the popupInfo from the associated FeatureLayerCollection/Service Item Object.&lt;/P&gt;&lt;P&gt;It's unwieldy and clunky but it's the best I could do in the time allotted...adding here for posterity.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Create Item object from item ID
itm = gis.content.get(itm_id)

# STEP 1: Make the dictionary of popupInfo and stuff in dict.

id_dict = [] # List to hold item IDs from which popupInfo is harvested
pop_dict = {} # Dict to hold popupInfo

wm = WebMap(itm)

for lyr in wm.layers:
    
    # Get the feature layer URL as key for dictionary
    fl_url = FeatureLayer(lyr).url["url"]
    
    # Get the itemID of the feature layer
    fl_itmid = FeatureLayer(lyr).url["itemId"]
    
    # Skip item ID if already done
    if fl_itmid in id_dict:
        continue
    
    # Add item ID to list to keep track of what services we've already checked
    id_dict.append(fl_itmid)
    
    # Get the Item itself
    flc_itm = gis.content.get(fl_itmid)
    
    # Get the item data (this is where the JSON we need lives...i.e.
    # ...this is what ArcGIS Assistant shows you when you click "View item JSON")
    flc_data = flc_itm.get_data()
    
    # Grab the value (list of layer info) at the key "layers"
    lyrs_info = flc_data["layers"]
    
    # Iterate through info for all layer info in the service
    for l in lyrs_info:
        
        # For each layer: make the key URL
        head = fl_url.rsplit("/",1)[0]
        tail = str(l["id"])
        key_url = f"{head}/{tail}"
        
        # FINALLY, WE GET OUR HANDS ON THE GODDAMNED POPUPINFO!!
        pop_info = l["popupInfo"]
    
        # Assign popupInfo to dict with feature layer URL as key
        pop_dict[key_url] = pop_info

# STEP 2: Assign the popupInfo to the correct layers in the webmap
itm_data = itm.get_data()

# Loop through operational layers
for ops_lyr in itm_data["operationalLayers"]:
    
    # Grab url (full URL including layer ID)
    ol_url = ops_lyr["url"]
    
    # Check whether popupInfo already exists for layer:
    if not "popupInfo" in ops_lyr:
        
        # Compare ops layer URL to url keys in dict from above
        if ol_url in pop_dict:
            
            # If there's a match, toss in the popupInfo!
            ops_lyr.update({"popupInfo": pop_dict[ol_url]})
            
            print(ol_url)
            print("popupInfo successfully added!\n")

# Update item_properties
itm_props = {"text": itm_data}
itm.update(item_properties = itm_props)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 23:02:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1176669#M7421</guid>
      <dc:creator>AlderMaps</dc:creator>
      <dc:date>2022-05-23T23:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1176841#M7424</link>
      <description>&lt;P&gt;Wow, thanks!&amp;nbsp; I have go through this more carefully when I get more time, but nothing's as unwieldy or clunky as having to use the UI for this so I'm sure it will be an improvement.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 14:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1176841#M7424</guid>
      <dc:creator>Sean-Sweeney</dc:creator>
      <dc:date>2022-05-24T14:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1262337#M8416</link>
      <description>&lt;P&gt;Hi Sean, I was wondering if you managed to get this to work? I'm also working with Feature Layers (not WebMaps) and am having the same None return on new FeatureLayers.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 07:33:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1262337#M8416</guid>
      <dc:creator>KappiPatterson</dc:creator>
      <dc:date>2023-02-28T07:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Configure Popup Attributes Programmatically with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1262415#M8418</link>
      <description>&lt;P&gt;I still haven't gotten around to trying&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/199227"&gt;@AlderMaps&lt;/a&gt;' solution. It's been sitting there on my to-do list mocking me, for almost a year now I see.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 13:05:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/configure-popup-attributes-programmatically-with/m-p/1262415#M8418</guid>
      <dc:creator>Sean-Sweeney</dc:creator>
      <dc:date>2023-02-28T13:05:08Z</dc:date>
    </item>
  </channel>
</rss>

