Is this possible to programmatically insert survey responses into the 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_075dd44dce89477b8j3d8l3kfb562554/FeatureServer/0
-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_075dd44dce89477b8j3d8l3kfb562554/FeatureServer/0/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
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.
You can populate answers from the Survey URL.
See here: How To: Prepopulate fields in Survey123 for ArcGIS by modifying a custom URL
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.