Select to view content in your preferred language

Availability to add a live device location question in survey form

172
5
Thursday
SeifElDinYasser
Esri Contributor

@ChristopherCounsell

I learned before that when creating a geopoint question in a Survey123 XLSForm and setting its default value to position, the location is automatically captured.

However, from my understanding, this picked location represents the device location at the moment the form is opened, not a continuously updated (live) location.

My question is:
Is it possible to get the live / updated device location while the form is still open?
For example, if the surveyor opens the form in one place and then moves to another location, can the geopoint value update automatically to reflect the new position?

I’m asking this in the context of geofencing in Survey123 Connect.
What I’m trying to achieve is:

  • If the surveyor is within a specific distance from a predefined point, the remaining survey questions should appear.

  • If he is outside that distance, those questions should remain hidden.

So my main concern is:
If the surveyor opens the form outside the allowed distance and then walks closer to the target location,
do they need to close and re-open the form for the questions to appear?
Or is there a way for the form to react dynamically to the updated location without reopening it?

Thanks in advance.

Tags (1)
0 Kudos
5 Replies
Neal_t_k
MVP Regular Contributor

While it wouldn't be the same as streaming, you could use the "press-to-locate" appearance, allowing users to decide when to capture their location.

https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformsappearance.htm

If your geopoint is visible, procedurally for your users, they can refresh the geopoint question when ever they want. without opening and closing the form 

Neal_t_k_0-1767363068058.png

Neal_t_k_1-1767363085890.png

 

SeifElDinYasser
Esri Contributor

Hi Neal,

Your solution already validates to user to change his location based on his current position, but I also want to prevent user to enter any other location except his current position. "press-to-locate" option allows him to pick any point manually by hand.

0 Kudos
Philip-Wilson
Esri Contributor

Hi @SeifElDinYasser,

As per @Neal_t_k's response, it sounds as though the "press-to-locate" appearance would meet your requirements, forcing the user to capture the geopoint when they are in the correct location by manually pressing the button. In this case the geopoint does not get populated on load.

Alternatively, if the location of where they are supposed to collect the geopoint is known, and you have those coordinates stored in the survey as hidden fields or in a csv file, you could use a pulldata("@geopoint") calculation based on the geopoint question and extract the coordinates it collected on form load, and do a "geofence" style calculation to provide the user a message to say if the point they collected was within a certain tolerance of the point they were supposed to collect. You can also use this to hide or show the following questions based on if they are in the correct location.

Here is a great blog post on that exact topic: https://community.esri.com/t5/arcgis-survey123-blog/limiting-extent-in-which-a-point-can-exist/ba-p/...

Regards,

Phil.

SeifElDinYasser
Esri Contributor

Hi Philip,

There's no specific extent, applied geofencing here ensures that the user is about specific distance from a point he chose its name from another question, these points are pulled from a feature service, so I don't know in advance what the point he will choose.
The press to locate is suitable to get his current position, but I need to prevent the user to pick any other point on the map but his current location. So I'm still in the issue of validating his location input.

Keeping the geopoint question to be readonly can't be done with "press-to-locate" question the map will not be shown for the user and he will not be able to locate his current location.

So, I'm trying to find somehow keeps the user picking his current location only.

 

0 Kudos
Neal_t_k
MVP Regular Contributor

@SeifElDinYasser I had one more thought on a work around for this.  It is not elegant, but could be a solution given I am not sure the exact functionality is there:   What if you configure the geopoint the same way you describe but inside a repeat. The user would have to then keep adding repeats at different locations until the questions showed up for them.  Subsequent repeats are completely empty until they are created, so this should capture current location on the creation of the new repeat, not the start of the form.

0 Kudos