In the 2.3 release of Survey123 we made some changes to the way that surveys are published when working against ArcGIS Enterprise. These changes affect surveys using both hosted and federated feature services.
Background
When publishing hosted services to ArcGIS Enterprise, the service's data is stored in the Portal for ArcGIS Data Store. It is a requirement of the Data Store's underlying PostgreSQL database that all field names are lowercase, and this affects the service field names too. Although questions in Survey123 can be mixed case, if the app is to successfully write to these services, then the case used must match (i.e. be lowercase).
Previous versions of Survey123 would let you publish surveys with mixed case questions, as the field app would fix the case on submission. Unfortunately, this caused a problem when working with federated services (which can be mixed case), as forcing the field names to be lowercase resulted in miss matches in some circumstances.
Fixing the case on submission was a workaround we implemented to make it easier for the end user. However, in hindsight we should have ensured that survey was published using the correct case in the first place, and this is what we are doing now.
What has changed?
As result of the above, at 2.3 we have stopped the field app from fixing field cases on submission. Instead we have made Connect do two new checks when publishing a survey, that ensure the following:
If either of the above is not true, the user will now be prompted to manually fix the question names before being able to publish.
How could this affect you?
If you have existing surveys published against the ArcGIS Data Store, with mixed case question names, and you have upgraded to the 2.3 version of the field app, you will no longer be able to submit data to any mixed case question/fields.
As previously mentioned, this is because the app is no longer changing field names to be lowercase on submission. While the survey will successfully submit in this situation, any mixed case fields in the service will be left blank.
What do you need to do?
If you don't have un-submitted data on your field devices, all you need to do republish your surveys using the 2.3 version of Connect. The republishing process will identity any mixed case issues and prompt you to fix them (i.e. make all questions lowercase) before letting you re-publish. Remember that on top on changing question names, you will need to update any references to them, e.g. the calculation field or the form_id. But again you will not be able to re-publish the survey until all such issues are resolved.
Once republished, users in the field will be able to download the latest version of the survey and continue their work.
If you do have un-submitted data on field devices, you will need to get the .sqlite database off the field device and re-submit the data using a desktop version of the field app. There are two approaches that you can use for this.
Make sure you create a back up of your database before attempting the below.
Approach 1
Using version 2.3 of the field app (Windows, Mac of Linux) run through steps 1-9 in the second part of Recover data from a mobile device in Troubleshoot—Survey123 for ArcGIS | ArcGIS. However, before you complete step 5, you will need to fix the field cases in the database. This can be done by updating and executing the following statement for each affected question:
UPDATE Surveys SET data = REPLACE (data,'"Offences":', '"offences":')
The example above will set the Offences field to be lowercase for all surveys in the database. You will need to run an updated version of the statement for each mixed case question. Once complete, you can the proceed with steps 5-9.
Approach 2
Using a version prior to 2.3 of the field app (Windows, Mac of Linux) run through steps 1-5 in the first part of of Recover data from a mobile device in Troubleshoot—Survey123 for ArcGIS | ArcGIS. This will be the easier option if you have not yet upgraded Connect to 2.3.
After you have successfully re-submitted the surveys from the device, you should then go through and republish all affected surveys, as described above.
We hope that this change will not affect you too negatively and do regret that we did not provide a more advanced warning of the above. We are however planning to release some tools that will make the process of getting data out of the field app’s .sqlite database much easier – so please watch this space. In the meantime, if you have any questions, or need further advice or clarification please let us know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.