<?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 Save list of WebMaps as json file using ArcGIS API python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163794#M7308</link>
    <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have list of WebMap with its Item id's, Is is possible to save the items information as JSON file for backup and can be used later to update the WebMap. How can I save the list of WebMap items information as JSON using ArcGIS API python ??&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 09:32:49 GMT</pubDate>
    <dc:creator>Aravinthkumar</dc:creator>
    <dc:date>2022-04-13T09:32:49Z</dc:date>
    <item>
      <title>Save list of WebMaps as json file using ArcGIS API python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163794#M7308</link>
      <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have list of WebMap with its Item id's, Is is possible to save the items information as JSON file for backup and can be used later to update the WebMap. How can I save the list of WebMap items information as JSON using ArcGIS API python ??&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 09:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163794#M7308</guid>
      <dc:creator>Aravinthkumar</dc:creator>
      <dc:date>2022-04-13T09:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Save list of WebMaps as json file using ArcGIS API python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163885#M7311</link>
      <description>&lt;P&gt;When you get a web map's&amp;nbsp;&lt;STRONG&gt;properties&lt;/STRONG&gt;, you can simply use the&amp;nbsp;&lt;STRONG&gt;json&amp;nbsp;&lt;/STRONG&gt;module to conver the properties dict to JSON, then write that to a file.&lt;/P&gt;&lt;P&gt;Can you elaborate on what your list looks like? Is it just a list of itemIDs?&lt;/P&gt;&lt;P&gt;Assuming you have a list of ids as strings, you could do something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS

gis = GIS('your portal url')
maps = ['list', 'of', 'itemids']
out_dir = 'output directory'

for m in maps:
    prop = gis.content.get(m).get_data()
    
    with open(f'{out_dir}/{m}.json', 'w') as file:
        file.write(json.dumps(prop))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which results in something like the following (ignore that 'test.gdb' item):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1649857431893.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38773iDB1F0D9BC931874F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1649857431893.png" alt="jcarlson_0-1649857431893.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any of which, if you opened up, would have the full JSON of the web map.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1649857479014.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38774i67DE5D6ED47A3B05/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1649857479014.png" alt="jcarlson_1-1649857479014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 13:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163885#M7311</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-04-13T13:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Save list of WebMaps as json file using ArcGIS API python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163908#M7312</link>
      <description>&lt;P&gt;Hello Josh Carlson,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the input. The list looks like below with 56 map id's in a file&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fds.PNG" style="width: 458px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38779i61DF382A20135CC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="fds.PNG" alt="fds.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does this kind of input can be used ??&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should be given in the below variable maps ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;maps = ['list', 'of', 'itemids']&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Does this also saves the legends of the Maps ??&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 14:07:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163908#M7312</guid>
      <dc:creator>Aravinthkumar</dc:creator>
      <dc:date>2022-04-13T14:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Save list of WebMaps as json file using ArcGIS API python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163914#M7313</link>
      <description>&lt;P&gt;Yes, it can certainly be used. You should refer to &lt;A href="https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects" target="_self"&gt;python's &lt;STRONG&gt;read&lt;/STRONG&gt; method&lt;/A&gt; for more information about how to do that.&lt;/P&gt;&lt;P&gt;A map's legend is based on layer symbology, which is defined in the JSON, so yes, the legend will be the same.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 14:15:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-list-of-webmaps-as-json-file-using-arcgis-api/m-p/1163914#M7313</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-04-13T14:15:40Z</dc:date>
    </item>
  </channel>
</rss>

