AnsweredAssumed Answered

CreateReplica with layerQueries Fails

Question asked by sjacksonesriaustralia-com-au-esridist Employee on Jan 4, 2019
Latest reply on Jan 9, 2019 by sjacksonesriaustralia-com-au-esridist

I have a public hosted feature in ArcGIS Online (test data) which has SYNC enabled.

Using the Python API I want to download a file geodatabase, but also include a WHERE clause to download a subset of the data. 


I am having a problem with the WHERE clause.


I can perform a standard REST query to get some records from an individual layer.

WHERE type='JAM'


I can also successfully download a file geodatabase using the createReplica endpoint via REST:


createReplica OK


However, if I want to apply a WHERE clause, I am having some problems getting the layerQueries parameter to work via REST


{"0":{"queryOption": "useFilter", "where": "type = JAM", "useGeometry": false}}

{"0":{"where": "type = JAM"}}

Both of the above result in:

Exporting data for layer 0 failed.


Can anyone point out what is wrong with my layerQueries param, I am sure it must be something simple.


I intend on using this via Python as below, but I figure I need to be able to get it work directly against the REST API before troubleshooting in Python.

replica = waze_flc.replicas.create(replica_name = 'Waze_Download',
                                   layer_queries = {"0":{"queryOption": "useFilter", "where": "type = JAM", "useGeometry": false}},
                                   layers = '0',
                                   data_format = 'filegdb',
                                   out_path = './download')



The field I actually need to perform the WHERE clause on is a timestamp, to get the last 24 hours of data.