<?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 ERROR 001558: Error parsing json file in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1409051#M9878</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am receiving the below error message when downloading json file from a feature layer collection. The script is running on a windows PC at work.&lt;/P&gt;&lt;P&gt;However, at home, on windows as well, the script works perfectly and the json file is parsed and loaded into a file geodatabase.&lt;/P&gt;&lt;P&gt;ERROR 001558: Error parsing json file &amp;lt;filename.json&amp;gt;. A general error when some thing is wrong with a Field. [&amp;lt;fieldname&amp;gt;].&lt;/P&gt;&lt;P&gt;Failed to execute (JSONToFeatures).&lt;/P&gt;&lt;P&gt;The field in question holds the global id.&lt;/P&gt;&lt;P&gt;I have compared the temp json files downloaded at home and on the work PC and they are exactly the same.&lt;/P&gt;&lt;P&gt;The code is being run in VS Code on both machines.&lt;/P&gt;&lt;P&gt;Thanks very much for any ideas anyone may have.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for lyr in itemObject.layers:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;# output feature class name&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;out_fc = '{}'.format(re.sub(r'[^A-Za-z0-9]+', '', lyr.properties.name))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;# TableName is now original name, minus any spaces.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;# use query to return a feature set object&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;export = lyr.query(query="owner:" + gis.users.me.username, item_type="Feature Layer") # url of sub layer.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;print("Create export for: {}".format(out_fc))&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;# Works fine to this point.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;# The "export.save...." is the section that fails, as it tries to parse the json file. &lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;export.save(os.path.join(gdblocation, gdbname), out_fc)&amp;nbsp; # save json file of layer to fgdb.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2024 15:58:24 GMT</pubDate>
    <dc:creator>Rich</dc:creator>
    <dc:date>2024-04-12T15:58:24Z</dc:date>
    <item>
      <title>ERROR 001558: Error parsing json file</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1409051#M9878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am receiving the below error message when downloading json file from a feature layer collection. The script is running on a windows PC at work.&lt;/P&gt;&lt;P&gt;However, at home, on windows as well, the script works perfectly and the json file is parsed and loaded into a file geodatabase.&lt;/P&gt;&lt;P&gt;ERROR 001558: Error parsing json file &amp;lt;filename.json&amp;gt;. A general error when some thing is wrong with a Field. [&amp;lt;fieldname&amp;gt;].&lt;/P&gt;&lt;P&gt;Failed to execute (JSONToFeatures).&lt;/P&gt;&lt;P&gt;The field in question holds the global id.&lt;/P&gt;&lt;P&gt;I have compared the temp json files downloaded at home and on the work PC and they are exactly the same.&lt;/P&gt;&lt;P&gt;The code is being run in VS Code on both machines.&lt;/P&gt;&lt;P&gt;Thanks very much for any ideas anyone may have.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for lyr in itemObject.layers:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;# output feature class name&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;out_fc = '{}'.format(re.sub(r'[^A-Za-z0-9]+', '', lyr.properties.name))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;# TableName is now original name, minus any spaces.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;# use query to return a feature set object&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;export = lyr.query(query="owner:" + gis.users.me.username, item_type="Feature Layer") # url of sub layer.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;print("Create export for: {}".format(out_fc))&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;# Works fine to this point.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;# The "export.save...." is the section that fails, as it tries to parse the json file. &lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;export.save(os.path.join(gdblocation, gdbname), out_fc)&amp;nbsp; # save json file of layer to fgdb.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 15:58:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1409051#M9878</guid>
      <dc:creator>Rich</dc:creator>
      <dc:date>2024-04-12T15:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 001558: Error parsing json file</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1409376#M9879</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/462917"&gt;@Rich&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I switch machines where it worked on one and not the other, I initially check the API versions. Your home version might be a newer version that your work version.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis
print(arcgis.__version__)&lt;/LI-CODE&gt;&lt;P&gt;If there are indeed both the same, we can then rule that out as a cause.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2024 06:33:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1409376#M9879</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-04-14T06:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 001558: Error parsing json file</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1409660#M9886</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/417766"&gt;@Clubdebambos&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks very much for your response.&lt;/P&gt;&lt;P&gt;There is a difference in the arcgis versions.&lt;/P&gt;&lt;P&gt;Home:&amp;nbsp;2.2.0.1&lt;/P&gt;&lt;P&gt;Work: 2.1.0.2&lt;/P&gt;&lt;P&gt;I'll look into getting arcgis upgraded on my work PC and see if that resolves the issue.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 09:37:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1409660#M9886</guid>
      <dc:creator>Rich</dc:creator>
      <dc:date>2024-04-15T09:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 001558: Error parsing json file</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1422088#M9996</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I eventually managed to get my company to install an updated version of ArcGIS Pro.&lt;/P&gt;&lt;P&gt;This has resolved the json parsing issue.&lt;/P&gt;&lt;P&gt;Thanks very much for your help.&lt;/P&gt;&lt;P&gt;Rich.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 13:13:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-001558-error-parsing-json-file/m-p/1422088#M9996</guid>
      <dc:creator>Rich</dc:creator>
      <dc:date>2024-05-09T13:13:07Z</dc:date>
    </item>
  </channel>
</rss>

