2000 rows limitation with api export json data

1829
3
07-31-2022 08:43 PM
LeahYan
New Contributor

Hi all. My name is Leah, I am working as a data specialist to help my team with reporting and data analysis. We have a GIS partner who built a web app for us. The web app is used for collecting data from offline environments, and it works great with our workflow. We also have a powerBI dashboard to use the data collected from this web app for reporting. 

I am able to set up the Rest API with auth token to refresh the data from a feature layer, however, I can export 4200 rows from the ArcGIS online (https://<services-url>/arcgis/rest/services/<layer-name>/FeatureServer/0).

Only 2000 rows were exported if I use Rest API  (https://<services-url>/arcgis/rest/services/<layer-name>/FeatureServer/0/query?where=1%3D1&outFields=*&returnGeometry=false&resultRecordCount=0&f=json&token=token).

I followed another post https://support.esri.com/en/technical-article/000012383 to change the maxRecordCount to 8000. Even so, I still get only 2000 rows from my export json file. 

LeahYan_0-1659325228886.png

Does anyone have an idea why this would be happening? Is anything I can do to export the entire dataset from a feature layer host on ArcGIS online? If not, is there any workaround for PowreBI data refreshing?

Thanks for the help!

 

 

Tags (1)
0 Kudos
3 Replies
JoshuaBixby
MVP Esteemed Contributor

Have you read the Query (Feature Service/Layer)—ArcGIS REST APIs | ArcGIS Developers documentation?  Specifically, the parts about resultType and max record count?

0 Kudos
Raul_Jimenez
Esri Contributor

I have never been able to increase the maxRecordCount above 2000, but you have two options:

1) Use the "resultOffset" parameter (which is the pagination mechanism): <- this is the one I would recommend

Raul_Jimenez_1-1659428587690.png

2) Use the asynchronous/job "https://[root]/content/users/[userName]/export" endpoint to generate a file.

Another page that you might want to check is the Feature service page within the "Mapping APIs and locations services guide" (it is a conceptual guide about many of the cross concepts of the ArcGIS system, including the REST APIs).

I hope this helps.

0 Kudos
AW_Grove
Occasional Contributor

Hi @Raul_Jimenez - do you have an example query where you have used the resultOffset option? Below is what I am using right now, but seeing max of 2000 records. I don't see the resultOffset parameter in the query documentation so I am wondering if it is supported with this method. 

0 Kudos