<?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: Transferring Survey123 data with clone_items() fails due to XML parsing in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transferring-survey123-data-with-clone-items-fails/m-p/1084615#M6419</link>
    <description>&lt;P&gt;Downgrading to Python 3.6.0 resolved this issue. I attempted this after finding a &lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/clone-surveys-from-one-organization-to-another/bc-p/1082273" target="_self"&gt;blog post discussing survey cloning&lt;/A&gt;, then finding a related &lt;A href="https://github.com/Esri/Survey123-tools/tree/main/Clone%20Surveys" target="_self"&gt;Github page&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jul 2021 20:49:06 GMT</pubDate>
    <dc:creator>gvanderwaal</dc:creator>
    <dc:date>2021-07-30T20:49:06Z</dc:date>
    <item>
      <title>Transferring Survey123 data with clone_items() fails due to XML parsing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transferring-survey123-data-with-clone-items-fails/m-p/1056426#M6038</link>
      <description>&lt;P&gt;I'm attempting to transfer Survey123 data from ArcGIS Online to our Enterprise Portal. I have been attempting to use the "Clone_Survey_Content_Full_Folder" script linked &lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/moving-surveys-from-arcgis-online-to-our-enterprise-portal/m-p/770026/highlight/true#M3547" target="_self"&gt;here&lt;/A&gt;. It successfully transfers all data except the survey form itself. The error(s) it fails at are at the bottom of this post.&lt;/P&gt;&lt;P&gt;Line 14, column 61 of &lt;FONT face="courier new,courier"&gt;_replace_form&lt;/FONT&gt;'s &lt;FONT face="courier new,courier"&gt;xml_string&lt;/FONT&gt; is the red line in this screenshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gvanderwaal_0-1620677352681.png" style="width: 491px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12993i60ECAD941A72929A/image-dimensions/491x86?v=v2" width="491" height="86" role="button" title="gvanderwaal_0-1620677352681.png" alt="gvanderwaal_0-1620677352681.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Pasting the contents of &lt;FONT face="courier new,courier"&gt;xml_string&lt;/FONT&gt; into an online XML validator confirms an error at 14:61. I assume ElementTree wants the &lt;FONT face="courier new,courier"&gt;&amp;lt;/label&amp;gt;&lt;/FONT&gt; to be to the right of &lt;FONT face="courier new,courier"&gt;&amp;lt;label class&amp;gt;&lt;/FONT&gt; or to not exist at all, because doing either in said XML validator shifts to a new error at line 22:71, also caused by a an out-of-place &lt;FONT face="courier new,courier"&gt;&amp;lt;/label&amp;gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;I'm hoping this is something resolved by changing software versions or something similarly easy.&lt;/P&gt;&lt;P&gt;ArcGIS Pro/ArcMap not installed locally&lt;BR /&gt;ArcGIS Enterprise/Portal 10.8.1&lt;BR /&gt;Python 3.9.5 64-bit&lt;BR /&gt;ArcGIS API 1.8.5.post3 installed via pip&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/251557"&gt;@ZacharySutherby&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\_impl\common\_clone.py", line 3104, in update_form
    payload['form'] = self._replace_form(form, field_mapping)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\_impl\common\_clone.py", line 2944, in _replace_form
    xml = ElementTree.fromstring(xml_string)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\xml\etree\ElementTree.py", line 1347, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: mismatched tag: line 14, column 61

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\_impl\common\_clone.py", line 3006, in clone
    self.update_form(self.target, new_item, self._clone_mapping)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\_impl\common\_clone.py", line 3181, in update_form
    raise Exception("Failed to update {0} {1}: {2}".format(new_item['type'], new_item['title'], str(ex)))
Exception: Failed to update Form IA-OA Sampling Form V2: mismatched tag: line 14, column 61

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\workspace\Clone_Surveys\Clone_Survey_Content_Full_Folder-mod.py", line 70, in &amp;lt;module&amp;gt;
    cloned_items = target.content.clone_items(items=fldr_items, folder=fldr['title'])
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\gis\__init__.py", line 5517, in clone_items
    return deep_cloner.clone()
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\_impl\common\_clone.py", line 813, in clone
    results = executor.submit(self._clone, executor).result()
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 445, in result
    return self.__get_result()
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 390, in __get_result
    raise self._exception
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\_impl\common\_clone.py", line 800, in _clone
    raise ex
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\arcgis\_impl\common\_clone.py", line 3013, in clone
    raise _ItemCreateException("Failed to create {0} {1}: {2}".format(original_item['type'], original_item['title'], str(ex)), new_item)
arcgis._impl.common._clone._ItemCreateException: ('Failed to create Form IA-OA Sampling Form V2: Failed to update Form IA-OA Sampling Form V2: mismatched tag: line 14, column 61', &amp;lt;Item title:"IA-OA Sampling Form V2" type:Form owner:the_owner_of_portal_account&amp;gt;)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 20:36:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transferring-survey123-data-with-clone-items-fails/m-p/1056426#M6038</guid>
      <dc:creator>gvanderwaal</dc:creator>
      <dc:date>2021-05-10T20:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Transferring Survey123 data with clone_items() fails due to XML parsing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transferring-survey123-data-with-clone-items-fails/m-p/1060139#M6093</link>
      <description>&lt;P&gt;Does anyone have any pointers in the right direction? This seems like an uncommon error and I haven't seen anyone else encounter it yet.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 19:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transferring-survey123-data-with-clone-items-fails/m-p/1060139#M6093</guid>
      <dc:creator>gvanderwaal</dc:creator>
      <dc:date>2021-05-20T19:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Transferring Survey123 data with clone_items() fails due to XML parsing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transferring-survey123-data-with-clone-items-fails/m-p/1084615#M6419</link>
      <description>&lt;P&gt;Downgrading to Python 3.6.0 resolved this issue. I attempted this after finding a &lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/clone-surveys-from-one-organization-to-another/bc-p/1082273" target="_self"&gt;blog post discussing survey cloning&lt;/A&gt;, then finding a related &lt;A href="https://github.com/Esri/Survey123-tools/tree/main/Clone%20Surveys" target="_self"&gt;Github page&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 20:49:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transferring-survey123-data-with-clone-items-fails/m-p/1084615#M6419</guid>
      <dc:creator>gvanderwaal</dc:creator>
      <dc:date>2021-07-30T20:49:06Z</dc:date>
    </item>
  </channel>
</rss>

