How to prepopulate a geopoint location in S123 from an existing feature in Collector?

402
6
Jump to solution
02-28-2020 12:33 PM
KacyBeck2
New Contributor II

I have a map with a layer that contains points for security lights that need to be inspected.

I also have a Survey 123 form that the field personnel will use to fill out for each inspection location.

I have already set up a Custom URL in the popup configuration for the existing security light features to prepopulate most of the Survey 123 questions with attribute information from the security lights existing information.

What I'm having trouble with is finding a way, if there is, to prepopulate the geopoint question in the Survey 123 form with the location data from the point that the Custom URL is clicked on to start the survey.

Is there a simple way to do this with a custom URL?

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
MikeBruening1
Regular Contributor

You will need to do two things the help this work -

  1. Add two data fields to the original layer to contain the Latitude and Longitude coordinate values for each of the security lights.
  2. You will need to add to the end of the Custom URL the following &center= ${Latitude},${Longitude}


This should pre-populate the the Geopoint question with the location of the security light the employee is working on.

Good luck,

Mike

View solution in original post

Reply
0 Kudos
6 Replies
MikeBruening1
Regular Contributor

You will need to do two things the help this work -

  1. Add two data fields to the original layer to contain the Latitude and Longitude coordinate values for each of the security lights.
  2. You will need to add to the end of the Custom URL the following &center= ${Latitude},${Longitude}


This should pre-populate the the Geopoint question with the location of the security light the employee is working on.

Good luck,

Mike

View solution in original post

Reply
0 Kudos
KacyBeck2
New Contributor II

I came across that solution since I do have existing X and Y fields, however it's not working for me.

I have since read that the Latitude and Longitude need to be in Decimal Degrees in those fields, whereas mine are not (i.e- X is 1284877.1711 and Y is 2108151.0050).

So I'm having trouble getting my coordinates in the correct format through AGOL, assuming that's what's causing the issue here.

Reply
0 Kudos
KacyBeck2
New Contributor II

So I ended up just using ArcMap to do a Calculate Geometry for Decimal Degrees on a new field, and reload the feature to AGOL.

I used the &center= ${Latitude},${Longitude} however it worked fine for me without the "$"s

Reply
0 Kudos
DryCreekEng
Occasional Contributor

I have crews checking pest traps and they record their data using Collector. I would like the trap ID in the Collector map to prepopulate based on their location when they get to a trap. Kacy, does your script do something similar by prepopulating fields based on their location near a known point? If so, can you share how you created the URL popup to do that?

Thanks,

Natalie

Reply
0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Natalie,

Please refer to Integrate with other apps—Survey123 for ArcGIS | Documentation  - fields can be prepopulated by using the URL parameter field:<field_name>=<value> .  As an example, you would create a URL in the web map pop-up of the map Collector uses:

arcgis-survey123://?itemID=<FORM_ID>&field:trap_id_q={trap_id}

where <FORM_ID> is the item id of the form you want to open, trap_id_q is the name of the question you want to populate and trap_id is the field in the layer in Collector that you want to use as a value.

Reply
0 Kudos
DryCreekEng
Occasional Contributor

Thank you James, this was very helpful. I was able to get it functioning correctly.

Reply
0 Kudos