how to save featurelayer into json by javascript in web app?

08-03-2021 04:05 AM
Occasional Contributor III

ESRI Graphic has "toJson()" method, but Feature Layer has not such a methos. How do I save a feature layer into json text file?

Tags (2)
0 Kudos
1 Reply
Frequent Contributor

You can query the features you're interested in, iterate them and run .toJSON() on each feature. There's no quick way to export all features to JSON though, due to stuff like server query limits. 


Oh and FeatureLayer queries return a FeatureSet, and that has a toJSON() method on it too.

0 Kudos