<?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: Python API add multiple typeKeywords  in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875866#M4901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried something like :&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;targetMap['typeKeywords'].append(['Collector', 'Offline'])&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Nov 2016 11:55:16 GMT</pubDate>
    <dc:creator>NeilAyres</dc:creator>
    <dc:date>2016-11-24T11:55:16Z</dc:date>
    <item>
      <title>Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875865#M4900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying the&amp;nbsp;ArcGIS Python API. What I want to achieve is to create copies of ArcGIS Online maps, and update filters for different users for use in Collector. Part one works, but getting the map appear in Collector does now work. A map in ArcGIS needs one of the&amp;nbsp;typeKeywords to be 'Collector' and I need the keyword 'Offline' there as well so users can use the download and sync functionality (Which is the same as the 'Enable offline mode.' tickbox in the map settings in ArcGIS online).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script is copied and adapted from the example:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/sample-notebooks/Clone-Portal-Users-Groups-and-Content/" title="https://developers.arcgis.com/python/sample-notebooks/Clone-Portal-Users-Groups-and-Content/"&gt;Clone Portal Users, Groups and Content | ArcGIS for Developers&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I have, is that the typeKeywords of the original map are not copied correctly to the new maps. The typeKeywords of the original and copied map are:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;print(sourceMap.typeKeywords)&lt;/P&gt;&lt;P&gt;['ArcGIS Online', 'Collector', 'Data Editing', 'Explorer Web Map', 'Map', 'Offline', 'Online Map', 'Web Map']&lt;/P&gt;&lt;P&gt;print(targetMap.typeKeywords)&lt;/P&gt;&lt;P&gt;["'Collector'", "'Data Editing'", "'Explorer Web Map'", "'Map'", "'Offline'", "'Online Map'", "'Web Map']", "['ArcGIS Online'", 'ArcGIS Online', 'Explorer Web Map', 'Map', 'Online Map', 'Web Map']&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE style="color: #000000; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/PRE&gt;&lt;P&gt;This list of keywords is a mess, and the resulting map does not show in Collector.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can partly solve the problem by setting a single extra typeKeyword as follows:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;targetMap.update({'typeKeywords': 'Collector'})&lt;/P&gt;&lt;P&gt;print(targetMap.typeKeywords)&lt;/P&gt;&lt;P&gt;['ArcGIS Online', 'Collector', 'Explorer Web Map', 'Map', 'Online Map', 'Web Map']&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This adds the Collector keyword successfully and the map shows up in Collector, but cannot be synced. If I add the additional Offline keyword the same way, the Collector keyword is removed and I can't use the map in Collector:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;targetMap.update({'typeKeywords': 'Collector'})&lt;/P&gt;&lt;P&gt;targetMap.update({'typeKeywords': 'Offline'})&lt;/P&gt;&lt;P&gt;print(targetMap.typeKeywords)&lt;/P&gt;&lt;P&gt;['ArcGIS Online', 'Explorer Web Map', 'Map', 'Offline', 'Online Map', 'Web Map']&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I add them in one command, I end up with faulty typeKeywords and the map is not available in Collector:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;targetMap.update({'typeKeywords': ['Collector', 'Offline']})&lt;/P&gt;&lt;P&gt;print(targetMap.typeKeywords)&lt;/P&gt;&lt;P&gt;["'Offline']", "['Collector'", 'ArcGIS Online', 'Explorer Web Map', 'Map', 'Online Map', 'Web Map']&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I add both Collector and Offline keywords without destroying the typeKeywords field? (Or how do I copy typeKeywords successfully?)&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2016 09:45:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875865#M4900</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-11-24T09:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875866#M4901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried something like :&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;targetMap['typeKeywords'].append(['Collector', 'Offline'])&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2016 11:55:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875866#M4901</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-24T11:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875867#M4902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion Neil. I tried this, but unfortunately it does not solve the problem.&amp;nbsp;It adds the keywords to the item in Python, but after updating the map in ArcGIS online the extra keyword is dropped again.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;targetMap.typeKeywords.append('Offline')&lt;BR /&gt;print(targetMap.typeKeywords)&lt;BR /&gt;['ArcGIS Online', 'Collector', 'Explorer Web Map', 'Map', 'Online Map', 'Web Map', 'Offline']&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;targetMap.update()&lt;BR /&gt;print(targetMap.typeKeywords)&lt;BR /&gt;['ArcGIS Online', 'Collector', 'Explorer Web Map', 'Map', 'Online Map', 'Web Map']&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2016 13:10:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875867#M4902</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-11-24T13:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875868#M4903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My original should be :&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;targetMap&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'typeKeywords'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extend&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Collector'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Offline'&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Where you are adding to the list in the dict key "typeKeywords".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you are saying that the targetMap object doesn't "remember" these settings.&lt;/P&gt;&lt;P&gt;Are these settings read/write or only read?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2016 13:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875868#M4903</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-24T13:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875869#M4904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The keywords are successfully added to the targetMap object, using either extend or append two times, that part works. But the added keywords are are lost when pushing the changes to ArcGIS online with the update() command. This part could be intended as the documentation does not suggest this approach, but it was worth trying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, adding the a new keyword is no problem using the recommended / documented command&amp;nbsp;targetMap.update({'typeKeywords': 'Offline'}). The problem is that&amp;nbsp;a&amp;nbsp;second&amp;nbsp;addition is not stored.&lt;/P&gt;&lt;P&gt;Using one command for two keywords, targetMap.update({'typeKeywords': [ 'Offline', 'Collector']}), results in a mess (as shown in opening post).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2016 14:07:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875869#M4904</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-11-24T14:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875870#M4905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wouter Marra, can you verify if your web map meets all the data requirements specified in this&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/collector/android/create-maps/supported-data.htm"&gt;Collector for ArcGIS documentation&lt;/A&gt;. Further, if you want to use sync capability in Collector, at least one of your feature layers should have the 'sync' capability enabled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Dec 2016 03:15:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875870#M4905</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-12-24T03:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875871#M4906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/242472" target="_blank"&gt;Wouter Marra&lt;/A&gt;‌ in addition to the requirements in the previous comment, the typeKeywords need to be added as a comma separated string. Hence in your case, you need to add it as&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;'ArcGIS Online, Explorer Web Map, Map, Offline, Online Map, Web Map, Collector'
You can write your update code as&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;webmap_item.update({'typeKeywords':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'ArcGIS Online, Explorer Web Map, Map, Offline, Online Map, Web Map, Collector'})&lt;SPAN class="line-numbers-rows"&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:59:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875871#M4906</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T10:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add multiple typeKeywords</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875872#M4907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;While get_data() returns a list for the typeKeywords property, update() is expecting it&amp;nbsp;to be provided as a comma separated string. That turned out to be what was tripping me up trying to use&amp;nbsp;same cloning example code you referenced. The example&amp;nbsp;doesn't handle the typeKeywords property correctly, as it will simply tries to pass to update() what it got from get_data(), so&amp;nbsp;the copied item ends up corrupted.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Mar 2017 19:50:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-multiple-typekeywords/m-p/875872#M4907</guid>
      <dc:creator>PeterKnoop</dc:creator>
      <dc:date>2017-03-19T19:50:56Z</dc:date>
    </item>
  </channel>
</rss>

