AnsweredAssumed Answered

Parameters to export fcs & tables from AGOL using where clause

Question asked by whitney on Jul 27, 2020
Latest reply on Jul 29, 2020 by whitney

How can one export both the layers and tables from a feature layer in AGOL while respecting the where clause?

 

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[]

 

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}]})

 

If, instead, I use the following syntax, both the layers and tables export successfully, but the where_clause is ignored:

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}]})

 

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:

where_clause = "CreationDate > '7/1/2020' and EditDate > '7/1/2020'"

Outcomes