Location use overlay for 'Geo' based/Map questions in Survey123

1591
12
Jump to solution
06-02-2021 01:16 AM
Adam_Coburn_NCC
New Contributor II

Hello all,

I am building a form in Survey123 Connect (version - 3.12.232) that involves the use of 'geo' type questions (GeoPoint, GeoTrace, and GeoShape).

For the form to be publicly published, my organisation require a notification type feature to be included which informs the submitter that these questions will attempt to obtain and use their location.

Forms which are created from the Survey123 Web Designer are able to include this in a very slick and stylish way. This is done via ticking/checking the 'Ask for device's location when opening this question' box that appears once the map widget has been added to the form (See attached image). 

My question is, can this be recreated in Survey123 Connect? 

Thanks in advance,

Adam

1 Solution

Accepted Solutions
Philip-Wilson
Esri Frequent Contributor

Hi @Adam_Coburn_NCC,

The web app is required to ask for the users permission to use location due to the way that modern browsers work, and each website you use must ask for location permission first. This is a requirement of the browser, otherwise the web app will not be able to get a location.

With the field app, when you install the app for the first time, you are prompted to allow the app to use your current location, this is accepted once for the app. You can always go and modify the setting in the location services system setting on the device. Because of this, we can not ask permission on a per survey basis.

However, you can achieve a similar workflow in the field app by using a relevant expression on the geopoint question, and having a select one yes/no question prior to the geopoint, that asks the user for permission. For instance, a select one question "Do you give permission for this survey to collect your current location?" and then have two answers yes or no. If they select yes, the geopoint location becomes relevant and visible, and get the current location. If they select no, the geopoint is not relevant, and does not collect any location data.

Hope this helps.

Regards,

Phil.

View solution in original post

12 Replies
Philip-Wilson
Esri Frequent Contributor

Hi @Adam_Coburn_NCC,

The web app is required to ask for the users permission to use location due to the way that modern browsers work, and each website you use must ask for location permission first. This is a requirement of the browser, otherwise the web app will not be able to get a location.

With the field app, when you install the app for the first time, you are prompted to allow the app to use your current location, this is accepted once for the app. You can always go and modify the setting in the location services system setting on the device. Because of this, we can not ask permission on a per survey basis.

However, you can achieve a similar workflow in the field app by using a relevant expression on the geopoint question, and having a select one yes/no question prior to the geopoint, that asks the user for permission. For instance, a select one question "Do you give permission for this survey to collect your current location?" and then have two answers yes or no. If they select yes, the geopoint location becomes relevant and visible, and get the current location. If they select no, the geopoint is not relevant, and does not collect any location data.

Hope this helps.

Regards,

Phil.

View solution in original post

Adam_Coburn_NCC
New Contributor II

Hi Phil,

Thanks for the above. 

Due to the way the wider project is being delivered, I do not envisage the Survey123 field app to be used in-conjunction with this particular form. I'm expecting nearly all traffic to be via traditional web browsers.   

Testing of the form in the Survey123 web app did not generate a location use permission from the browser.

The option of adding in a select_one question (with use of the relevant column) is probably the easiest work around. I had initially considered this but with the design and flow of the form I would rather not use this option if another 'sleeker' option exists.  

Philip-Wilson
Esri Frequent Contributor

Hi @Adam_Coburn_NCC,

Unfortunately there is no 'sleeker' way in the field app to ask for permission on the actual geopoint question that I can think of.

Also, for the web app, if the user has already given permission to survey123 website and web app to allow location permissions, this will be saved for that website in the browsers settings. Should only be asked once, unless you revoke the permission.

Regards,

Phil.

 

 

Adam_Coburn_NCC
New Contributor II

Excellent, Thanks Phil. I'll ensure further testing is done from an environment that has not previously given permission to the Survey123 site. 

DougBrowning
MVP Frequent Contributor

Not sure on the web app but in the field app I set a default on the geopoint of 0,0 which forces the user to tap on it.  You could test that.

Adam_Coburn_NCC
New Contributor II

Hi @Philip-Wilson @DougBrowning 

Following on from the above I would greatly appreciate your feedback for the following option regarding my original post.

To ensure we are complying with UK GDPR we are unable to leave the location access permission down to the web browser for the Survey123 site. The permission needs to be obtained per form as the submitter may have, in the past, completed another unrelated Survey123 form. 

Adding a select one question is a simple fix, but if I can avoid it, I'd like to. 

To add in a new feature I recreated the form in version 3.12 and saw this now includes a guidance_hint column. This places a light bulb symbol at the beginning of  any hint text (image attached). In the question hint I am going to state that this question will attempt to access your location. To learn more please select the light bulb symbol.

@Philip-Wilson do you know if this icon can be styled? If not are there any plans for this feature?

Cheers,

Adam

0 Kudos
Philip-Wilson
Esri Frequent Contributor

Hi @Adam_Coburn_NCC,

It is not currently possible to style or change the light bulb icon. Also not in any current plans for a future release either, as it has never previously been raised as a request or enhancement. Please create it as an Esri Community Idea and also log it with Esri Support as an offical enhancement, if this is something you would like to see supported in the future.

Regards,

Phil.

0 Kudos
Adam_Coburn_NCC
New Contributor II

Hi @Philip-Wilson 

I have now published this form but when I open the survey in the Survey123  web app I receive an error pop up stating TypeError: Cannot read property 'previousElementSibling' of null. 

I've had a quick search on the Community pages and from this post https://community.esri.com/t5/arcgis-survey123-questions/cannot-read-property-previouselementsibling... it appears some others have also experienced a similar issue. 

The form is still accessible by closing the pop up but the geopoint, trace and shape questions with their repeats do not function correctly. The first geo question preforms correctly but when you select the + button the question is not correctly presented it shows a second repeat but no geopoint etc exists within the repeat (image attached). I have also taken a screen shot of the error details from the developer tools option from the browser used. 

I am happy to share the xlsForm and files within the media folder but I am unable to upload the xlsform here as it contains the password used to currently access the form (this function will be removed from the form once the form has has received all internal sign-offs) happy to email it directly.

The form was published from Connect version 3.12

Files within the media folder are 1MT small.jpg and ncc_logo.PNG 

Cheers,

Adam

0 Kudos
Philip-Wilson
Esri Frequent Contributor

Hi @Adam_Coburn_NCC,

Can you please send me a private message with your xlsform and items from media folder. I can take a look at the error you are getting.

Note that guidance_hints are not supported in the web app for 3.12. This will be released as supported in 3.13 (the next release) for the web app. If you remove guidance_hints from your survey does the survey load fine in the web app?

Regards,

Phil.

0 Kudos