<?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: How to configure Map Image Layer Pop-up Attributes by Python? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1205551#M7664</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;PRE&gt;#Note: add the Layer in Map Viewer and Save Layer first, otherwise .get_data returns empty {}&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Was really hoping this was going to do the trick for me. Already have a script that works fine on a feature layer collection; have been asked to make this work for map img service, for which .get_data() returned empty.&lt;BR /&gt;&lt;BR /&gt;Tried the advice above...and get back a dict only 3 keys, visibleLayers, visibility and opacity. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I mean at least it's not empty...but was really hoping for the layers in there. Any insight into what my issue might be would be appreciated. For now, back to the drawing board...&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 19:46:30 GMT</pubDate>
    <dc:creator>AlderMaps</dc:creator>
    <dc:date>2022-08-23T19:46:30Z</dc:date>
    <item>
      <title>How to configure Map Image Layer Pop-up Attributes by Python?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1026107#M5534</link>
      <description>&lt;P&gt;I need help to check/uncheck programmatically the setting "Use 1000 Separator" of Pop-up's "Configure Attributes" for a layer inside of Map Image Layer (Source: Map Service).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Saw a sample to change the Pop-up settings for item of WebMap (&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/td-p/814850" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/enable-popup-in-web-map/td-p/814850&lt;/A&gt;), but not for item of Map Image Layer.&lt;/P&gt;&lt;P&gt;The Pop-up settings can be changed and saved back to the Image Map Layer by "Save Layer" using Map Viewer.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 22:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1026107#M5534</guid>
      <dc:creator>ChenLi</dc:creator>
      <dc:date>2021-02-11T22:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Map Image Layer Pop-up Attributes by Python?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1026183#M5538</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;This can be achieved using the ArcGIS API for Python.&lt;/P&gt;&lt;P&gt;If you access your AGOL Account/Enterprise Portal from ArcGIS Online Assistant&amp;nbsp;&lt;A href="https://ago-assistant.esri.com/" target="_blank"&gt;https://ago-assistant.esri.com/&lt;/A&gt;&amp;nbsp;you can view the structure of the popup info for your Map and Feature Service items.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you look at the "Data" section for a map or feature service (with popups enabled) in AGO Assistant, you can see the structure of popup information as JSON.&amp;nbsp; In particular, what you're after is the "digitSeparator" parameter (true/false).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example JSON for the data section of a map or feature service item:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "layers": [
        {
            "id": 0,
            "popupInfo": {
                "title": "Contours",
                "fieldInfos": [],
                "description": null,
                "showAttachments": true,
                "mediaInfos": []
            }
        },
        {
            "id": 1,
            "popupInfo": {
                "title": "Contours 0.25 m: {ELEVATION}",
                "fieldInfos": [
                    {
                        "fieldName": "OBJECTID",
                        "label": "Object ID",
                        "tooltip": "",
                        "visible": false,
                        "stringFieldOption": "textbox"
                    },
                    {
                        "fieldName": "ELEVATION",
                        "label": "Elevation (m) AHD",
                        "tooltip": "",
                        "visible": true,
                        "stringFieldOption": "textbox",
                        "format": {
                            "places": 2,
                            "digitSeparator": true
                        }
                    },
                    {
                        "fieldName": "CLASSIFICATION",
                        "label": "Classification",
                        "tooltip": "",
                        "visible": true,
                        "stringFieldOption": "textbox",
                        "format": {
                            "places": 2,
                            "digitSeparator": false
                        }
                    },
                    {
                        "fieldName": "SHAPE",
                        "label": "Shape",
                        "tooltip": "",
                        "visible": false,
                        "stringFieldOption": "textbox"
                    }
                ],
                "description": null,
                "showAttachments": true,
                "mediaInfos": []
            },
            "layerDefinition": {
                "defaultVisibility": true
            }
        },
        {
            "id": 2,
            "popupInfo": {
                "title": "Contours 5m: {ELEVATION}",
                "fieldInfos": [
                    {
                        "fieldName": "OBJECTID",
                        "label": "Object ID",
                        "tooltip": "",
                        "visible": false,
                        "stringFieldOption": "textbox"
                    },
                    {
                        "fieldName": "ELEVATION",
                        "label": "Elevation (m) AHD",
                        "tooltip": "",
                        "visible": true,
                        "stringFieldOption": "textbox",
                        "format": {
                            "places": 2,
                            "digitSeparator": true
                        }
                    },
                    {
                        "fieldName": "CLASSIFICATION",
                        "label": "Classification",
                        "tooltip": "",
                        "visible": true,
                        "stringFieldOption": "textbox",
                        "format": {
                            "places": 2,
                            "digitSeparator": true
                        }
                    },
                    {
                        "fieldName": "SHAPE",
                        "label": "Shape",
                        "tooltip": "",
                        "visible": false,
                        "stringFieldOption": "textbox"
                    },
                    {
                        "fieldName": "SHAPE_STLength__",
                        "label": "SHAPE.STLength()",
                        "tooltip": "",
                        "visible": false,
                        "stringFieldOption": "textbox",
                        "format": {
                            "places": 2,
                            "digitSeparator": true
                        }
                    }
                ],
                "description": null,
                "showAttachments": true,
                "mediaInfos": []
            }
        },
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;To access this via the api: First you can access the item through gis.content.get with the item ID.&lt;BR /&gt;Once you've got the item, use the get_data method&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=get_data#arcgis.gis.Item.get_data" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=get_data#arcgis.gis.Item.get_data&lt;/A&gt;&amp;nbsp;to download the JSON data above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you've got a copy of this data, you can iterate through the layers to programmatically change the value for "digitSeparator".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly, you can update the item through the item.update method.&amp;nbsp; This will push the changes back up into the map/feature service item.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;While I don't have a snippet available off the top of my head, I've used this process numerous times to update/migrate popup data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 06:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1026183#M5538</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-12T06:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Map Image Layer Pop-up Attributes by Python?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1026389#M5548</link>
      <description>&lt;P&gt;Thanks to&amp;nbsp;&lt;SPAN&gt;AlexBowler, the Python code works as&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;#Note: add the Layer in Map Viewer and Save Layer first, otherwise .get_data returns empty {}&lt;BR /&gt;gis = arcgis.gis.GIS("https://arcgis.com", verify_cert=False)&lt;BR /&gt;item = gis.content.get("4c44fb8e5a1f43acacxxxxxxx")&amp;nbsp;# The layer &amp;lt;item-id&amp;gt;&lt;BR /&gt;item_data = item.get_data(try_json=True)&lt;BR /&gt;item_data['layers'][0]['popupInfo']['fieldInfos'][1]['format']['digitSeparator'] = False&lt;BR /&gt;item_properties = {"text": json.dumps(item_data)}&lt;BR /&gt;item.update(item_properties=item_properties)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2021 18:01:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1026389#M5548</guid>
      <dc:creator>ChenLi</dc:creator>
      <dc:date>2021-02-12T18:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Map Image Layer Pop-up Attributes by Python?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1205551#M7664</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;PRE&gt;#Note: add the Layer in Map Viewer and Save Layer first, otherwise .get_data returns empty {}&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Was really hoping this was going to do the trick for me. Already have a script that works fine on a feature layer collection; have been asked to make this work for map img service, for which .get_data() returned empty.&lt;BR /&gt;&lt;BR /&gt;Tried the advice above...and get back a dict only 3 keys, visibleLayers, visibility and opacity. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I mean at least it's not empty...but was really hoping for the layers in there. Any insight into what my issue might be would be appreciated. For now, back to the drawing board...&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 19:46:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-configure-map-image-layer-pop-up-attributes/m-p/1205551#M7664</guid>
      <dc:creator>AlderMaps</dc:creator>
      <dc:date>2022-08-23T19:46:30Z</dc:date>
    </item>
  </channel>
</rss>

