<?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 Parameters to export fcs &amp; tables from AGOL using where clause in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/parameters-to-export-fcs-tables-from-agol-using/m-p/216407#M16658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class=""&gt;&lt;P&gt;How can one export both the layers and tables from a feature layer in AGOL while respecting the where clause?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following syntax exports the layers successfully, respecting the where_clause, but the tables do not export. I'm guessing I need something other than a comma in between the layers[] and tables[]&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;output_file = observations.export(title="Observations", export_format="File Geodatabase", parameters={"layers" :[{"id" : 0, "where" : where_clause},{"id" : 1, "where" : where_clause},{"id" : 2, "where" : where_clause},{"id" : 3, "where" : where_clause}], "tables":[{"id":4},{"id":5},{"id":6},{"id":7},{"id":8},{"id":9},{"id":10}]})&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If, instead, I use the following syntax, both the layers and tables export successfully, but the where_clause is ignored:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;output_file = observations.export(title="ObservationsTables", export_format="File Geodatabase", parameters= {"tables":[{"id":4, "where" : where_clause},{"id":5, "where" : where_clause},{"id":6, "where" : where_clause},{"id":7, "where" : where_clause},{"id":8, "where" : where_clause},{"id":9, "where" : where_clause},{"id":10, "where" : where_clause}]})&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;So, how do I get both the layers and tables to export according to the where_clause? I have verified the where_clause is successful in the first export, but just in case, here's the test where_clause I'm using:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;where_clause = "CreationDate &amp;gt; '7/1/2020' and EditDate &amp;gt; '7/1/2020'"&lt;/EM&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jul 2020 18:27:44 GMT</pubDate>
    <dc:creator>WhitneyWeber</dc:creator>
    <dc:date>2020-07-27T18:27:44Z</dc:date>
    <item>
      <title>Parameters to export fcs &amp; tables from AGOL using where clause</title>
      <link>https://community.esri.com/t5/python-questions/parameters-to-export-fcs-tables-from-agol-using/m-p/216407#M16658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class=""&gt;&lt;P&gt;How can one export both the layers and tables from a feature layer in AGOL while respecting the where clause?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following syntax exports the layers successfully, respecting the where_clause, but the tables do not export. I'm guessing I need something other than a comma in between the layers[] and tables[]&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;output_file = observations.export(title="Observations", export_format="File Geodatabase", parameters={"layers" :[{"id" : 0, "where" : where_clause},{"id" : 1, "where" : where_clause},{"id" : 2, "where" : where_clause},{"id" : 3, "where" : where_clause}], "tables":[{"id":4},{"id":5},{"id":6},{"id":7},{"id":8},{"id":9},{"id":10}]})&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If, instead, I use the following syntax, both the layers and tables export successfully, but the where_clause is ignored:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;output_file = observations.export(title="ObservationsTables", export_format="File Geodatabase", parameters= {"tables":[{"id":4, "where" : where_clause},{"id":5, "where" : where_clause},{"id":6, "where" : where_clause},{"id":7, "where" : where_clause},{"id":8, "where" : where_clause},{"id":9, "where" : where_clause},{"id":10, "where" : where_clause}]})&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;So, how do I get both the layers and tables to export according to the where_clause? I have verified the where_clause is successful in the first export, but just in case, here's the test where_clause I'm using:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;where_clause = "CreationDate &amp;gt; '7/1/2020' and EditDate &amp;gt; '7/1/2020'"&lt;/EM&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameters-to-export-fcs-tables-from-agol-using/m-p/216407#M16658</guid>
      <dc:creator>WhitneyWeber</dc:creator>
      <dc:date>2020-07-27T18:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Parameters to export fcs &amp; tables from AGOL using where clause</title>
      <link>https://community.esri.com/t5/python-questions/parameters-to-export-fcs-tables-from-agol-using/m-p/216408#M16659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Turns out I was over complicating the issue - all can be done within "layers", whether layers or tables, so the proper syntax is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;output_file = observations.export(title="ObservationsTables", export_format="File Geodatabase", parameters= {"layers":[{"id":0, "where" : where_clause},{"id":1, "where" : where_clause},{"id":2, "where" : where_clause},{"id":3, "where" : where_clause},{"id":4, "where" : where_clause},{"id":5, "where" : where_clause},{"id":6, "where" : where_clause},{"id":7, "where" : where_clause},{"id":8, "where" : where_clause},{"id":9, "where" : where_clause},{"id":10, "where" : where_clause}]})&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or, simplified:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;param = {"layers" :[{"id" : 0, "where" : where_clause}, {"id" : 1, "where" : where_clause}, {"id" : 2, "where" : where_clause}, {"id" : 3, "where" : where_clause}, {"id" : 4, "where" : where_clause}, {"id" : 5, "where" : where_clause}, {"id" : 6, "where" : where_clause}, {"id" : 7, "where" : where_clause}, {"id" : 8, "where" : where_clause}, {"id" : 9, "where" : where_clause}, {"id" : 10, "where" : where_clause}]}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;output_file = observations.export(title="Observations", export_format="File Geodatabase", parameters=param)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks to Calvin Kwon, Esri, for the solution!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2020 20:50:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameters-to-export-fcs-tables-from-agol-using/m-p/216408#M16659</guid>
      <dc:creator>WhitneyWeber</dc:creator>
      <dc:date>2020-07-29T20:50:49Z</dc:date>
    </item>
  </channel>
</rss>

