<?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: Set popup in a layer published by code in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1507623#M10360</link>
    <description>&lt;P&gt;I found the solution&lt;/P&gt;&lt;P&gt;There is a way to save the properties into the target service&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import json
serverData = serverPro.get_data(try_json=True)
item_properties = {"text": json.dumps(serverData)}
serverCode.update(item_properties=item_properties)&lt;/LI-CODE&gt;&lt;P&gt;Now I have to build this json (since I cannot get it from a service published from Pro) but this is simple task&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Jul 2024 04:47:39 GMT</pubDate>
    <dc:creator>mody_buchbinder</dc:creator>
    <dc:date>2024-07-21T04:47:39Z</dc:date>
    <item>
      <title>Set popup in a layer published by code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1504162#M10335</link>
      <description>&lt;P&gt;I am using standard code (from the examples) with arcpy and python api to publish a layer (by ref) with feature access.&lt;/P&gt;&lt;P&gt;When I load the mapImage into empty webmap the popup (identify) is turned off by default.&lt;/P&gt;&lt;P&gt;I need to turn it on to see the popups.&lt;/P&gt;&lt;P&gt;If I load the same mapImage to Pro&amp;nbsp; I do see identify without any extra setting.&lt;/P&gt;&lt;P&gt;When I use Pro (without code) to publish a web layer the problem does not exists. The layer have popups on by default.&lt;/P&gt;&lt;P&gt;I found a few examples about how you turn popup on in a WebMap (using get_data) but no example of how to do it for mapImage or feature service.&lt;/P&gt;&lt;P&gt;I can not find any different between the service that was published using code and the one I created in Pro without code.&lt;/P&gt;&lt;P&gt;Anybody know how to set the default popup to "on" in code for service (not WebMap)?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 14:19:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1504162#M10335</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2024-07-11T14:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set popup in a layer published by code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1504163#M10336</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413050"&gt;@mody_buchbinder&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you provide the code you are using to publish the service?&amp;nbsp; Also, is this occurring in Portal or ArcGIS Online?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 14:23:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1504163#M10336</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-07-11T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set popup in a layer published by code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1504609#M10339</link>
      <description>&lt;P&gt;The code I use is very similar to the solution here:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/publish-a-referenced-feature-service-from-arcgis/td-p/1054425" target="_blank"&gt;https://community.esri.com/t5/python-questions/publish-a-referenced-feature-service-from-arcgis/td-p/1054425&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It can be found in many versions in the Pro docs.&lt;/P&gt;&lt;P&gt;I am publishing to a local Portal.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 05:27:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1504609#M10339</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2024-07-12T05:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set popup in a layer published by code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1505666#M10347</link>
      <description>&lt;P&gt;I did some more testing. I published the same layer from Pro and code.&lt;/P&gt;&lt;P&gt;Then in notebook I have these lines:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS("pro")
idCode = "2f4b3fd237ae44b9af774adbbafa482f"
idPro = "47e920caec774f53a27a59217de07028"
serverCode = gis.content.get(idCode)
serverPro = gis.content.get(idPro)
serverPro.get_data(try_json=True)
#serverCode.get_data(try_json=True)&lt;/LI-CODE&gt;&lt;P&gt;So this return a json the represent the layer, it has popupElements tag in it.&lt;/P&gt;&lt;P&gt;When I uncomment the last line and try to get the data from the item published by code I get empty json.&lt;/P&gt;&lt;P&gt;I do not see any set_data method (incase I will create the json myself.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 05:05:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1505666#M10347</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2024-07-16T05:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set popup in a layer published by code</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1507623#M10360</link>
      <description>&lt;P&gt;I found the solution&lt;/P&gt;&lt;P&gt;There is a way to save the properties into the target service&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import json
serverData = serverPro.get_data(try_json=True)
item_properties = {"text": json.dumps(serverData)}
serverCode.update(item_properties=item_properties)&lt;/LI-CODE&gt;&lt;P&gt;Now I have to build this json (since I cannot get it from a service published from Pro) but this is simple task&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 04:47:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/set-popup-in-a-layer-published-by-code/m-p/1507623#M10360</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2024-07-21T04:47:39Z</dc:date>
    </item>
  </channel>
</rss>

