Select to view content in your preferred language

How to get the coordinates of where the survey was completed?

1245
6
Jump to solution
10-02-2023 01:42 AM
RachelS
Occasional Contributor III

Hi,

I'm wondering is there a way to get the coordinates of where the survey was completed as this could be in a different location to where the point is placed on the map.

 

Thanks

 

Rachel

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Attaching a sample XLSForm.

Important:

  • You need two geopoint questions. One to capture the location where the form is opened, and another one to set the location of something else, say an asset you are inspecting...
  • One of the two geopoint questions should be flagged as null in the bind::esri:fieldType column. You will need to calculate the XY coordinates into separate fields. Typically, this would be the question that logs the location of the user and it will be also hidden.
  • Note that the above will NOT work if you load the record form the Inbox. It will only work when creating a NEW record.

 

View solution in original post

6 Replies
abureaux
MVP Regular Contributor

You could always use a hidden geopoint question and extract x and y from that.

0 Kudos
RachelS
Occasional Contributor III

Isn't that the x and y of where the point was placed on the map rather than where the survey was sent from?

0 Kudos
TylerGraham2
Occasional Contributor

You'd need a second geopoint in your survey to get both user provided input and device provided location. You can get multiple geopoints into a survey by using a repeat with another geopoint type in it.  If you're looking at letting the user place a point on a map and then having a second geopoint to rat them out for working at a Starbucks all day, you'd have a geopoint in the main body of the form, then a second one in a repeat that would be hidden. This will create a related feature service when you publish the survey with the second geopoint type in it. 

If you set the geopoint default value to position it should provide the current location of the device even after reopening from a draft or inbox.

You can then pull the x,y by using pulldata("@geopoint").

Here's some more info.

https://doc.arcgis.com/en/survey123/browser/analyze-results/trackingsurveys.htm

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

https://doc.arcgis.com/en/survey123/desktop/create-surveys/geopoints.htm#ESRI_SECTION1_0C78C5A67E824...

 

RachelS
Occasional Contributor III

Thanks for replying Tyler, 

I'll have a look at those links, ideally I'd rather not use repeats if I could get the data in the same record. I got it working with Ismael's spreadsheet.

0 Kudos
IsmaelChivite
Esri Notable Contributor

Attaching a sample XLSForm.

Important:

  • You need two geopoint questions. One to capture the location where the form is opened, and another one to set the location of something else, say an asset you are inspecting...
  • One of the two geopoint questions should be flagged as null in the bind::esri:fieldType column. You will need to calculate the XY coordinates into separate fields. Typically, this would be the question that logs the location of the user and it will be also hidden.
  • Note that the above will NOT work if you load the record form the Inbox. It will only work when creating a NEW record.

 

RachelS
Occasional Contributor III

Thank you @Ismael,

This is exactly what I needed and works a treat.

0 Kudos