How to stop Survey123 to attempt to get user location? And how to use predetermined XY on a survey?

5595
24
Jump to solution
04-15-2022 09:40 AM
Gustavo_Souza
New Contributor III

For almost two years, we managed to create a map where the user clicks on a point, which opens a Survey123 form. The geopoint was set to read-only, and the URL had the center on XY coordinates (&center={Point_Y},{Point_X}). It worked flawlessly.

Until recently this system became unreliable. Not only new surveys do not work, but older ones are having the issues. They often try to get to the user's location. Or just center somewhere near Los Angeles. Or in Null Island. In different computers and web browsers. 

I figured out that the "&center=" URL thing is not reliable anymore to add points on that location (despite always working that way). So I read a bit about the calculations for geopoints, but it still does not work. 

Even by typing a coordinate on the default collum, for the geopoint field on the .xlsx form, (such as "48.858328 2.294513") , I get the message on the survey with no point selected:

- Can not find your location. Please check your browser to ensure that your location is shared

On top of that, there point And if I allow the location, then it points to my house.

I have then two questions:

  1. How can I ensure that the survey 123 will never attempt to overwrite the pre-defined values with the user location? Disabling the web browser permission is not a good option because many people use it, and its unrealistic to expect that everyone does it (and again, even when disabling, sometimes we get the error message).
  2. Even when writing a coordinate on the default value for the geopoint, the survey still does not ready it, sends me to LA. (and if I try to submit, it will go to 0,0). I tried using calculation too, but even if the simplest test does not work, I wonder what I am doing wrong.

Gustavo_Souza_0-1650040481513.png

Gustavo_Souza_1-1650040574277.png

Thanks for your help!

 

 

 

 

 

1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Hi @Gustavo_Souza 

I tried this out. If you set the default value of the geopoint question to null and you pass the center parameter, the geopoint value will keep your coordinates. I think this is the simplest approach, and the closest to what you already had. 

In my case, trying to set the value of the geopoint question directly using field:<nameofgeopointquestion> did not work.

Alternatively, you can also go with the XLSFom below and pass the point_x an point_y coordinates using field:point_x

IsmaelChivite_0-1650393285586.png

You may want to set the appearance in point_x and point_y to hidden so the questions are not visible. In practice, unless you want to store the X Y coordinates as attributes, I think the best is to just use the center parameter.

View solution in original post

24 Replies
DougBrowning
MVP Esteemed Contributor
Gustavo_Souza
New Contributor III

I already tried it yesterday. It does not fix the issue, and also adds the problem that if someone clicks on the map, it updates the point to their current location (even if the question is set to read only).

 

 

ZhifangWang
Esri Regular Contributor

Hi @Gustavo_Souza ,

There is a change since 3.14 release for the geopoint question that if you leave the default column empty in XLSForm, both the field app and web app will ask the device location on form load, while previously leaving the default column empty in XLSForm did nothing in the web app. If you don't want to get the device location on load in the web app, please set "null" as the value for the default column in the XLSForm. Please see the help topic mentioned by @DougBrowning above.

 

Hence, can you please try the following combination to see if it fits your workflow?

  1. Set "null" in the default column of the geopoint question in XLSForm
  2. Use the URL parameter "?field:geopoint1=48.858328 2.294513" , where geopoint1 is the name of your geopoint question. "?field:{questionName}=" is a more general approach than "?center=" in case there are multiple geopoint questions in your survey


Otherwise, can you please attach a simple XLSForm file that can reproduce your issue so we can look into?

 

Thanks,

Gustavo_Souza
New Contributor III

Hello Wang

Thanks for the answer. The null value works, it stopped asking for my location. But not it gives a blank value, not centering on the XY, but instead the map points at LA (which is the default value for blank geopoints?)

I tried every combination I could think of on the URL. I will prepare the XLS and send it!

0 Kudos
Gustavo_Souza
New Contributor III

Hello Wang

Please have a look at the Excel attached.

URL for the survey: https://survey123.arcgis.com/share/51a6fb606fdb43dc91d6d276bf635c12?&field:Point_Y=35.04197377513369...

I made an empty question to prevent people to submit it since it, is public.

The URL is using the center method to use grab the XY. The Point Y and Point X fields are just for testing and troubleshooting.

I tried changing from the center method to the "?field:geopoint1" way (named Repair_Point), but it does not work on my end. My goal is just to center on the "35.0419737 -85.307578" by any means necessary, without using the center approach. I tried using the documentation examples but it does not work for me.

 

0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi @Gustavo_Souza 

I tried this out. If you set the default value of the geopoint question to null and you pass the center parameter, the geopoint value will keep your coordinates. I think this is the simplest approach, and the closest to what you already had. 

In my case, trying to set the value of the geopoint question directly using field:<nameofgeopointquestion> did not work.

Alternatively, you can also go with the XLSFom below and pass the point_x an point_y coordinates using field:point_x

IsmaelChivite_0-1650393285586.png

You may want to set the appearance in point_x and point_y to hidden so the questions are not visible. In practice, unless you want to store the X Y coordinates as attributes, I think the best is to just use the center parameter.

Gustavo_Souza
New Contributor III

Hello @IsmaelChivite 

Thanks for your answer! That calculation you suggested works, even after removing the center on URL. I am not sure what I was doing wrong before, but I tried it in the past without success. Yes the XY were hidden, this was just a dummy survey to test things. And thanks a lot for all your posts regarding Survey 123, I do use them a lot.

And thanks @ZhifangWang as well.

0 Kudos
ahargreaves_FW
Occasional Contributor III

@IsmaelChivite I opted to simply use the "&center=<lat>,<long>" option. This works to place the point on the correct location on the map within a survey. However, the warning message shown below pops up after a few seconds unnerving the user. Is there a way to suppress this somehow? (my Geopoint must remain editable so the user can fine tune the location)

ahargreaves_FW_0-1662583337778.png

 

JessicaJThompson
Occasional Contributor II

Hi @IsmaelChivite ! 

I appreciate all of your assistance and documentation with Survey123.

I am still having the same issues as @Gustavo_Souza , after trying the advice you gave him, which did not work for my survey.

JessicaJThompson_1-1671738138921.png

My URL to open the survey in a browser is the following: 

https://survey123.arcgis.com/share/6b4d9fd3de71419a85fb69e48bf0_x_x_x_?field:MS4_ASSET_ID={FEATUREID...}&center={POINT_Y},{POINT_X}

The other fields are pulled into the survey. The geopoint is not working.

A number of my other surveys that were published with an earlier version of S123 are working still. What else can I try? I have a number of new surveys waiting on a solution.

Thank you & Happy Holidays!

Jessica Thompson

0 Kudos