Is this possible to programmatically insert survey responses into the Survey123?
Solved! Go to Solution.
Ok it is more complex. I think you can manually do it this way:
-Go to your ArcGIS Online account and open the Feature Service of the Survey. The URL will be similar to this: https://services3.arcgis.com/0lL78GhXbg1P07WO/ArcGIS/rest/services/service_075dd44dce89477b8j3d8l3kf...
-Look at the bottom for the "Add Features" button.
-Choose JSON format and try to add your JSON string.
To automate this with the REST API, I think you will need to create a POST request to a URL similar to this one: https://services3.arcgis.com/0lL78GhXbg1P07WO/ArcGIS/rest/services/service_075dd44dce89477b8j3d8l3kf.../addFeatures
The request will include the following parameters:
"format" (json), "token" and "features" (the JSON string).
You will need to programmatically ask ArcGIS Online for a token to use in your request.
EDIT: You can find more information about the "addFeatures" REST service at this link: Add Features—ArcGIS REST API: Services Directory | ArcGIS for Developers
You can populate answers from the Survey URL.
See here: How To: Prepopulate fields in Survey123 for ArcGIS by modifying a custom URL
Thanks for your response
The article you shared is helpful in a scenario when a user submits the prepopulated survey.
We are looking to integrate survey responses collected in a different system into Survey123.
Hence looking for an API capability to insert responses into Survey123.
Ok it is more complex. I think you can manually do it this way:
-Go to your ArcGIS Online account and open the Feature Service of the Survey. The URL will be similar to this: https://services3.arcgis.com/0lL78GhXbg1P07WO/ArcGIS/rest/services/service_075dd44dce89477b8j3d8l3kf...
-Look at the bottom for the "Add Features" button.
-Choose JSON format and try to add your JSON string.
To automate this with the REST API, I think you will need to create a POST request to a URL similar to this one: https://services3.arcgis.com/0lL78GhXbg1P07WO/ArcGIS/rest/services/service_075dd44dce89477b8j3d8l3kf.../addFeatures
The request will include the following parameters:
"format" (json), "token" and "features" (the JSON string).
You will need to programmatically ask ArcGIS Online for a token to use in your request.
EDIT: You can find more information about the "addFeatures" REST service at this link: Add Features—ArcGIS REST API: Services Directory | ArcGIS for Developers
Hi Nicolas,
Thanks for the detailed response
I am unable to locate the Feature Service of the Survey123 application from the web interface.
Any hints or clues?
I tried finding URL in the below sites
Thanks
Dinesh
Hi Dinesh,
Each Form Item has an associated Feature Layer (or Feature Layer View) - this can be identified as the link listed in the 'Layers' area of the form's item description. Feature Layers have interfaces that conform to the ArcGIS REST API.
In Survey123 Connect, there is a button to open the URL of the Survey in your ArcGIS Organisation website. From there,you should see the Feature Service of the Survey in your content.