<?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: Web map created with python API and feature services not displaying features in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778336#M1086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Atma,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A year after solving this issue, I am in the situation where I need to update the urls in a WebMap and cannot find a good way to do it. I am using the Python API 1.4 but have not found any way to update an Item or a WebMap contents via Json, and do not understand what Charlie (user cwarewa) meant by "&lt;SPAN style="background-color: #ffffff;"&gt;&lt;EM&gt;I then read that into the web map object for the new web map and now the features show up." &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I tried getting the json contents from a template web map with 'get_data()' as you described &lt;A _jive_internal="true" href="https://community.esri.com/thread/193624-save-items-as-json-with-arcgis-api-for-pyhton" target="_blank"&gt;here&lt;/A&gt;, and the used the updated json for the &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#arcgis.gis.Item" rel="nofollow noopener noreferrer" target="_blank"&gt;itemdict&lt;/A&gt;&lt;EM&gt;&lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.mapping.html#arcgis.mapping.WebMap" rel="nofollow noopener noreferrer" target="_blank"&gt;&amp;nbsp;&lt;/A&gt;&lt;/EM&gt;parameter on&amp;nbsp;a new Item object in addition to the itemid of a newly created, empty WebMap but the&amp;nbsp;map remained empty. As far as I can see, the &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.mapping.html#arcgis.mapping.WebMap.update" rel="nofollow noopener noreferrer" target="_blank"&gt;update function &lt;/A&gt;on the WebMap object is only for updating the item info and metadata, is that correct? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I also tried using the rest endpoint "update" as explained in this &lt;A _jive_internal="true" href="https://community.esri.com/thread/119536#448220" target="_blank"&gt;GeoNet question&lt;/A&gt; and in the &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/update-item.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Docs&amp;nbsp;&lt;/A&gt;but I get an error with the message "Item does not exist or is inaccessible" every time. Here's the section of code where I want to update the urls in the WebMap (token is created using same portal and credentials as the target_gis object):&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;# clone the template webmap
&lt;/SPAN&gt;template_WebMap = source_gis.content.get(templateWebMapId)
result_WebMaps = target_gis.content.clone_items([template_WebMap]&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;copy_data&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;False&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;
# get contents and update urls
&lt;/SPAN&gt;result_WebMap = getResultWebMap(result_WebMaps)
webMap_content = result_WebMap.get_data()
updated_WebMap_content = updateWebMapContent(webMap_content&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;new_hosted_service_url)
&lt;SPAN style="color: #808080;"&gt;
# prepare call to upload rest endpoint
&lt;/SPAN&gt;update_url = &lt;SPAN style="color: #6a8759;"&gt;"{}/sharing/rest/content/users/{}/items/{}/update"&lt;/SPAN&gt;.format(
&amp;nbsp;&amp;nbsp;&amp;nbsp; portalUrl&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;target_gis.users.me.orgId&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;result_WebMap.id)
update_params = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6a8759;"&gt;'text'&lt;/SPAN&gt;: json.dumps(updated_WebMap_content)&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;: token&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'
&lt;/SPAN&gt;}
update_response = urlopen(update_url&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;bytes&lt;/SPAN&gt;(urlencode(update_params)&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'utf-8'&lt;/SPAN&gt;))
update_ouput = json.loads(update_response.read().decode(&lt;SPAN style="color: #6a8759;"&gt;"utf-8"&lt;/SPAN&gt;))
&lt;SPAN style="color: #808080;"&gt;
# update_output = {'error': {'code': 400, 'message': 'Item does not exist or is inaccessible.', 
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#&amp;nbsp;&amp;nbsp; 'messageCode': 'CONT_0001', 'details': []}}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;So I am currently unable to update the map's contents in any way. Is there a preferred workflow for making updates to the Urls in the layers of a WebMap using the Python API?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:46:16 GMT</pubDate>
    <dc:creator>DanielMast</dc:creator>
    <dc:date>2021-12-12T08:46:16Z</dc:date>
    <item>
      <title>Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778326#M1076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the Python API to publish a web map using a hosted feature service that I published from a file geodatabase in My Content. I am following the example in the Python API sample Jupyter Notebook 'Publishing Web Maps and Web Scenes' in the '05 Content Publishers' group of notebooks. The map publishes fine, the basemap displays correctly but the features in the feature service do not show up when I view the web map in the Map Viewer. They are listed in the Details window correctly but do not have any symbology. When I click on the &amp;nbsp;Legend button it says there is no legend. If I create a web map from with ArcGIS Online using the same feature service, the features show up correctly.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:25:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778326#M1076</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-18T16:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778327#M1077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you shared the feature service publicly?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:36:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778327#M1077</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2017-04-18T16:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778328#M1078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The feature service is shared to the organization. It's the same organization in which I created the Web Map.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:39:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778328#M1078</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-18T16:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778329#M1079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Charlie, in the map viewer, can you view the attribute table (you can click on the table icon in table of contents for this) of the feature layer and ensure you see features in the table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that is the case, you might have dropped symbology for the features. By the way, are you running the exact sample or replacing with your content?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778329#M1079</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-18T16:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778330#M1080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see the attribute tables for the layers in the hosted feature layer. The source data for the layer is a hosted feature layer published from a file geodatabase that I uploaded to AGOL as a zip file. There never was any symbology for those features. However, when I click on the hosted feature layer in My Content, it displays the features with some sort of default symbology. I assumed that symbology would carry forward into the web map. Maybe I need to assign symbology to the features. Is there a sample for that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I replaced the data in the sample with my own hosted feature layer. The sample used a Map Service. I did it both from within a Jupyter Notebook and as a standalone python script and had the same result with both.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 17:04:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778330#M1080</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-18T17:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778331#M1081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;However, when I click on the hosted feature layer in My Content, it displays the features with some sort of default symbology.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, the smart-mapping capability of the map viewer in ArcGIS Online would try to render your features even if you do not have a symbology set, that could be what you are seeing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define a feature layer's symbology in at least 3 places.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In the feature layer definition,&lt;/LI&gt;&lt;LI&gt;In the feature layer's item&lt;/LI&gt;&lt;LI&gt;In the web map (which you are publishing now)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We don't have a sample or guide that discusses symbology (yet). To keep things simple, I would recommend you set the symbology in your web map (option 3 above) using the workflow below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Style your feature layer with the necessary symbology in the map viewer and save that web map.&lt;/LI&gt;&lt;LI&gt;Read that map using Python API into the WebMap class. View the definition, particularly the `drawingInfo` dictionary. You can access this like below:&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;your_web_map_obj['operationalLayers'][0]['layerDefinition']['drawingInfo']['renderer']&lt;/BLOCKQUOTE&gt;where the [0] refers to first layer.&lt;/LI&gt;&lt;LI&gt;Modify and apply the `layerDefinition` dictionary of that web map to the script that you are publishing.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see this is a popular workflow, we will work on getting this added to our SDK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 17:32:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778331#M1081</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-18T17:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778332#M1082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for getting back so quickly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I view my web map as a web map object, the operational layers are missing the entire 'layerDefinition' key (along with some others). I'm now looking into how to copy in a layerDefinition from one map into mine or create one from scratch and then publish that.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 19:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778332#M1082</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-18T19:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778333#M1083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it to work but it's somewhat convoluted. I created a web map from the hosted feature layer, read that into a web map object and then output it's layerDefinitions to a text file. I then copy/pasted the layerDefinition key from the text file into the web_map_simple.json file from the sample in the example Jupyter notebook. I then read that into the web map object for the new web map and now the features show up.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 21:31:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778333#M1083</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-18T21:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778334#M1084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Congrats! If you wish, you can avoid the step of saving to file by working with all the definitions, in-memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also look at the &lt;A href="https://developers.arcgis.com/web-map-specification/"&gt;Web Map spec&lt;/A&gt;&amp;nbsp;document which specifies the various parameters that define a web map json. For instance here is the&amp;nbsp;&lt;A href="https://developers.arcgis.com/web-map-specification/objects/layerDefinition/"&gt;layerDefinition&lt;/A&gt;&amp;nbsp;dictionary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 21:49:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778334#M1084</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-18T21:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778335#M1085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Atma for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2017 22:01:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778335#M1085</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-18T22:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778336#M1086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Atma,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A year after solving this issue, I am in the situation where I need to update the urls in a WebMap and cannot find a good way to do it. I am using the Python API 1.4 but have not found any way to update an Item or a WebMap contents via Json, and do not understand what Charlie (user cwarewa) meant by "&lt;SPAN style="background-color: #ffffff;"&gt;&lt;EM&gt;I then read that into the web map object for the new web map and now the features show up." &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I tried getting the json contents from a template web map with 'get_data()' as you described &lt;A _jive_internal="true" href="https://community.esri.com/thread/193624-save-items-as-json-with-arcgis-api-for-pyhton" target="_blank"&gt;here&lt;/A&gt;, and the used the updated json for the &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#arcgis.gis.Item" rel="nofollow noopener noreferrer" target="_blank"&gt;itemdict&lt;/A&gt;&lt;EM&gt;&lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.mapping.html#arcgis.mapping.WebMap" rel="nofollow noopener noreferrer" target="_blank"&gt;&amp;nbsp;&lt;/A&gt;&lt;/EM&gt;parameter on&amp;nbsp;a new Item object in addition to the itemid of a newly created, empty WebMap but the&amp;nbsp;map remained empty. As far as I can see, the &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.mapping.html#arcgis.mapping.WebMap.update" rel="nofollow noopener noreferrer" target="_blank"&gt;update function &lt;/A&gt;on the WebMap object is only for updating the item info and metadata, is that correct? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I also tried using the rest endpoint "update" as explained in this &lt;A _jive_internal="true" href="https://community.esri.com/thread/119536#448220" target="_blank"&gt;GeoNet question&lt;/A&gt; and in the &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/update-item.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Docs&amp;nbsp;&lt;/A&gt;but I get an error with the message "Item does not exist or is inaccessible" every time. Here's the section of code where I want to update the urls in the WebMap (token is created using same portal and credentials as the target_gis object):&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;# clone the template webmap
&lt;/SPAN&gt;template_WebMap = source_gis.content.get(templateWebMapId)
result_WebMaps = target_gis.content.clone_items([template_WebMap]&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;copy_data&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;False&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;
# get contents and update urls
&lt;/SPAN&gt;result_WebMap = getResultWebMap(result_WebMaps)
webMap_content = result_WebMap.get_data()
updated_WebMap_content = updateWebMapContent(webMap_content&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;new_hosted_service_url)
&lt;SPAN style="color: #808080;"&gt;
# prepare call to upload rest endpoint
&lt;/SPAN&gt;update_url = &lt;SPAN style="color: #6a8759;"&gt;"{}/sharing/rest/content/users/{}/items/{}/update"&lt;/SPAN&gt;.format(
&amp;nbsp;&amp;nbsp;&amp;nbsp; portalUrl&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;target_gis.users.me.orgId&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;result_WebMap.id)
update_params = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6a8759;"&gt;'text'&lt;/SPAN&gt;: json.dumps(updated_WebMap_content)&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;: token&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'
&lt;/SPAN&gt;}
update_response = urlopen(update_url&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;bytes&lt;/SPAN&gt;(urlencode(update_params)&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'utf-8'&lt;/SPAN&gt;))
update_ouput = json.loads(update_response.read().decode(&lt;SPAN style="color: #6a8759;"&gt;"utf-8"&lt;/SPAN&gt;))
&lt;SPAN style="color: #808080;"&gt;
# update_output = {'error': {'code': 400, 'message': 'Item does not exist or is inaccessible.', 
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#&amp;nbsp;&amp;nbsp; 'messageCode': 'CONT_0001', 'details': []}}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;So I am currently unable to update the map's contents in any way. Is there a preferred workflow for making updates to the Urls in the layers of a WebMap using the Python API?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:46:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778336#M1086</guid>
      <dc:creator>DanielMast</dc:creator>
      <dc:date>2021-12-12T08:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778337#M1087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniel, as of Python API versions 1.3 and later, you can directly work with `WebMap` object to add, remove layers, update URLs and finally call the `update()` method off the WebMap object. Below is an example for the problem you are trying to solve (cloning a web map, customizing it with your urls).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# clone web map&lt;/SPAN&gt;
template_webmap_item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; source_gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;template_webmap_id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
result_webmaps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; target_gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;clone_items&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;template_webmap_item&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; copy_data&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# edit the cloned web map&lt;/SPAN&gt;
cloned_webmap_item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; result_webmaps&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;# replace url&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; WebMap
cloned_webmap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; WebMap&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cloned_webmap_item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# replace url - repeat for as many layers you need&lt;/SPAN&gt;
cloned_webmap&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="punctuation token"&gt;.&lt;/SPAN&gt;url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'replacement_url'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# push updates to portal&lt;/SPAN&gt;
cloned_webmap&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;/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 08:46:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778337#M1087</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T08:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778338#M1088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Atma,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip! I hadn't worked with the API in a while and didn't realize I could work with the WebMap object directly. We are experiencing strange behaviour with the update() function: when calling&amp;nbsp;cloned_webmap.update() with no parameters, the urls are not updated in the webmap. When I give a dictionary of item_properties as a first argument, then the urls are updated but the properties (ie title, name, description, tags...) are not updated. I have also tried the same properties with .save() which I would expect to create a new WebMap but it seems nothing is happening. Another thing we tried is changing the properties directly such as&amp;nbsp;cloned_WebMap_item.title = webMapTitle and then ran update() again, but that also made no difference... here's the code snippet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; web_map_properties &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"title"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Test WebMap"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"description"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Test WebMap description"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"tags"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;: &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Calculation, Result"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; cloned_webmap.update(web_map_properties)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; cloned_WebMap_item.title &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Test WebMap"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; cloned_webmap.update(web_map_properties)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any suggestions or notice what I am doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 10:01:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778338#M1088</guid>
      <dc:creator>DanielMast</dc:creator>
      <dc:date>2018-04-27T10:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Web map created with python API and feature services not displaying features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778339#M1089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniel, I will test this out and get back to you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 16:28:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/web-map-created-with-python-api-and-feature/m-p/778339#M1089</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-04-27T16:28:22Z</dc:date>
    </item>
  </channel>
</rss>

