Hi
I'm writing a program to automatically add new data readings to a hosted ArcGIS Online feature layer. See the request URL below:
https://services6.arcgis.com/<ID>/arcgis/rest/services/<my_table>/FeatureServer/0/addFeatures
The addFeatures request takes a payload item "features", which I can successfully send as:
[ { "attributes" : { "Name" : "TestName", "ColumnTwo": 2 } }]
The issue: not being able to send multiple 'features' in the above section. My hunch is I am simply miss-typing the json data.
Thank you.
Features use a format like (assuming you are not including geometry):
[ { "attributes" : { "Name" : "TestName", "ColumnTwo": 2 } }, { "attributes" : { "Name" : "TestName2", "ColumnTwo": 3 } } ]<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Note the coma on line 7 as it joins the next feature. Typically, the feature would include "attributes" and "geometry".
[ { "attributes" : { "Name" : "TestName", "ColumnTwo": 2 }, "geometry" : { "x" : -111.111, "y" : 111.111 } } ]<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
For more information see: Add Features
I knew I was missing a comma in there somewhere. Thanks mate!
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.