Working with Survey123 items in ArcGIS.com, is there a property exposed anywhere in the system that identifies whether an item is accepting responses?I've checked the following documentation and have not been able to find any such property:Survey item properties returned via SurveyManager in ArcGIS API for Python - https://developers.arcgis.com/python/api-reference/arcgis.apps.survey123.html#arcgis.apps.survey123.SurveyManager
Item reference in the rest api - https://developers.arcgis.com/rest/users-groups-and-items/item.htm
@ZacharySutherby do you have any insight on this?
Hey @MillerDerek,
There's a few aspects to this and depends on where you're looking to use the information.
You can control "accepting responses" on both the Survey123 form item side and/or the feature service side too. So depending on where you're looking to control this depends on where you'll need to look.
From the Survey123 form item side you have the ability to set a survey status in the Survey123 website to open or closed. Closed being not accepting responses and open being accepting responses. With this though it doesn't control anything on the feature service so the survey can be "closed" but the feature service could still be pulled into a web map and edited. This open/closed status on the Survey123 form item is stored in it's .info file which isn't exposed through the item properties like you see in the ArcGIS API for Python.
You can access the .info file through the sharing/rest URL by accessing:
https://<webContextURL>/sharing/rest/content/items/<surveyItemID/info/<surveyName>.info?f=json&token=<validAccessToken>
The open/closed status will be under webformInfo -> settings -> openStatusInfo -> status
On the feature service side you can also check if add/update/delete capabilities are set on the service.
Not sure what your full use case is but if you're looking to use an open/closed status in the Survey123 field app, the field app doesn't support the setting from the website, but what you can do is use a custom JavaScript function (assuming the survey isn't to be shared publicly) to query the sharing/rest endpoint, obtain the status, then set up a constraint based on the status to prevent submission.
Thanks, Zachary.
Current use case is a simple read-only property to use in some internal admin tools.
I'm getting the following error:
{'error': {'code': 400, 'messageCode': 'CONT_0001', 'message': 'Item does not exist or is inaccessible.', 'details': []}}
Request URL I'm using is:
https://<<org arcgis online root>>/sharing/rest/content/items/<<item id>>/info/<<item name>>.info?f=json&token=<<token returned via /generateToken>>
Am I missing something? URL formatted properly?
Thanks
Hello @MillerDerek,
The URL looks to be formatted correctly, one thing to check is the <<item name>> is encoded for example "Test survey" vs "Test%20survey".
If it's a web designer survey you may need to use https://www.arcgis.com/sharing/rest/content/items/<itemID>/info/form.json?f=json&token=
Are you obtaining your /generateToken from an automated API call or from the Survey123 website? One thing you can test is setting the referer to https://survey123.arcgis.com/surveys.
You can also see the request if you access the Collaborate tab in the Survey123 website you can filter the network traffic based on .info and it should return the request that Survey123 makes.
This note shouldn't play a role in the error observed, but I'll note not all surveys will have a webformInfo section in the .info file. If the survey was published from Connect it may or may not have it.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.