Select to view content in your preferred language

Expression To Add Survey123 Point Data to Field List

525
12
Jump to solution
08-29-2024 09:52 AM
RichardPasquale
Emerging Contributor

I'm working with a Survey123 results layer (view).  I would like to add the lat/long-goepoint location data to the field list in Field Maps.   I notice that when I try to select the Field where the GEOPOINT data is recorded by the user {PlotCenter} this data field is not availble in Field Maps.

How to add geopoint location from survey to Field Map field list?

My intent is to call on the features (survey point) location data Lat/Long, to inform a new survey to use the same location data.

Ultimately using a Pop-Up link link this:

https://survey123.arcgis.app?itemID=a544e9f859e74716a9

 

6d143cbdc0c938&field:SUID={SUID}&field:PlotID={PlotID}&field:PlotCenter={PlotCenter}&field:DateCompleted={DATE_COMPLETED}&field:SampleType={SampleType}&field:TransectAzimuth={TransectAzimuth} 

RichardPasquale_0-1724950213465.png

 

RichardPasquale_2-1724950308305.png

 

0 Kudos
2 Solutions

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Check out this post

https://resource.esriuk.com/blog/getting-started-with-url-parameters-in-survey123/https://community....

But it looks like this

arcgis-survey123://?itemID=36ff9e8c13e042a58cfce4ad87f55d19&field:surname=Klauser&center=37.8199,-122.4783,20

Also here for Arcade

https://community.esri.com/t5/arcgis-survey123-questions/integrating-survey123-with-field-maps-using... 

View solution in original post

0 Kudos
ToddW_stl
Esri Contributor

"to get a "select_one" value populated in the survey from a URL call up" sounds like you'd want a search() appearance, potentially with autocomplete, and set a default value.
https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-choice-filters/ba-...

https://community.esri.com/t5/arcgis-survey123-blog/dynamic-choice-lists-using-search-appearance/ba-...

 

I may not completely understand your workflow, but I still think mode=copy would get you what you want.  Without doing the Arcade button in Field Maps, you should be able to do this more easily in a pop-up in your web map.  In your initial post, you said:

Ultimately using a Pop-Up link link this:

https://survey123.arcgis.app?itemID=a544e9f859e74716a96d143cbdc0c938&field:SUID={SUID}&field:PlotID={PlotID}&field:PlotCenter={PlotCenter}&field:DateCompleted={DATE_COMPLETED}&field:SampleType={SampleType}&field:TransectAzimuth={TransectAzimuth}

I'm not sure if this is exactly what you're looking for, but try this:

  1. in your web map, configure pop-ups on your survey results layer
  2. add content > Text
  3. paste this url
    1. https://survey123.arcgis.app?itemID=a544e9f859e74716a96d143cbdc0c938?mode=copy&globalId={globalid} (if using survey from ArcGIS Online)
    2. NOTE: use &mode=edit&globalId= If using a survey from ArcGIS Enterprise. (This should include the portalUrl parameter before. Ex.  https://survey123.arcgis.com/share/<itemID>?portalUrl=<portalUrl>&mode=edit&globalId= )
  4. highlight and Cut this text
  5. type a friendly name for the hyperlink (example:  "Copy this result")
  6. highlight that friendly text and click the link button
  7. Paste the Cut URL
  8. click OK
  9. drag the text pop-up element to the top of your pop-up

This will create a clickable link in the pop-up of whatever survey result your click in the map.  It should open that result in COPY mode, effectively copying the location (and all attributes) to a new survey result upon submission.  If new results are on null island (0,0), ensure the geopoint question is visible in your survey, and read-only if you don't want the point location to be editable.

ToddW_stl_0-1725459163297.png

 

View solution in original post

0 Kudos
12 Replies
DougBrowning
MVP Esteemed Contributor

Arc never stores static lat longs in fields.  I think you can use Geometry($feature).X in an Arcade expression then send that expression in the URL.  You can use an Arcade result just like a field in the URL.

Like &field:Latitude={expression/expr0}

You can also do pulldata in your form to make them text fields and use that BUT if they ever move the point outside of the 123 form that value will be off.

Hope that helps

0 Kudos
ToddW_stl
Esri Contributor

My initial thought was to create a button in field maps that would open the target survey point in copy mode.  Let us know what you try and how it works!

0 Kudos
RichardPasquale
Emerging Contributor

I have been able to get the location data into two attribute fields (not sure if I can/need to get them into one).

RichardPasquale_0-1725395756625.png

Using pulldata in the .xls

RichardPasquale_1-1725396831375.png

 

I have not figured out how to get the field location data into the survey.

https://survey123.arcgis.app?itemID=d9eb2d2764c54c6a8a4b245f64bc5b42&field:SUID={SUID}&field:PlotID=...}&field:PlotCenter=({Lat_Y},{Long_X})&field:DateCompleted={DATE_COMPLETED}&field:SampleType={SampleType}&field:BreakPointDia={BreakPointDia}

Or if survey will even let me dictate the geopoint lcoation via calling up a field(s) from another form/survey.

I need to use the same survey, so making a specific survey for this process is not an option. Thus why I'm trying to call up all the "Plot Meta-Data" from the pre survey to populate the Post survey.

@DougBrowning I think Arcade expressions is going to be the winner here. I just need to work on my Arcade skills.

@ToddW_stl  I really like the  "Button"  I just don't know if I'm there yet with my skills.

I'm still trying to figure out how to get a "select_one" value populated in the survey from a URL call up.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Check out this post

https://resource.esriuk.com/blog/getting-started-with-url-parameters-in-survey123/https://community....

But it looks like this

arcgis-survey123://?itemID=36ff9e8c13e042a58cfce4ad87f55d19&field:surname=Klauser&center=37.8199,-122.4783,20

Also here for Arcade

https://community.esri.com/t5/arcgis-survey123-questions/integrating-survey123-with-field-maps-using... 

0 Kudos
ToddW_stl
Esri Contributor

"to get a "select_one" value populated in the survey from a URL call up" sounds like you'd want a search() appearance, potentially with autocomplete, and set a default value.
https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-choice-filters/ba-...

https://community.esri.com/t5/arcgis-survey123-blog/dynamic-choice-lists-using-search-appearance/ba-...

 

I may not completely understand your workflow, but I still think mode=copy would get you what you want.  Without doing the Arcade button in Field Maps, you should be able to do this more easily in a pop-up in your web map.  In your initial post, you said:

Ultimately using a Pop-Up link link this:

https://survey123.arcgis.app?itemID=a544e9f859e74716a96d143cbdc0c938&field:SUID={SUID}&field:PlotID={PlotID}&field:PlotCenter={PlotCenter}&field:DateCompleted={DATE_COMPLETED}&field:SampleType={SampleType}&field:TransectAzimuth={TransectAzimuth}

I'm not sure if this is exactly what you're looking for, but try this:

  1. in your web map, configure pop-ups on your survey results layer
  2. add content > Text
  3. paste this url
    1. https://survey123.arcgis.app?itemID=a544e9f859e74716a96d143cbdc0c938?mode=copy&globalId={globalid} (if using survey from ArcGIS Online)
    2. NOTE: use &mode=edit&globalId= If using a survey from ArcGIS Enterprise. (This should include the portalUrl parameter before. Ex.  https://survey123.arcgis.com/share/<itemID>?portalUrl=<portalUrl>&mode=edit&globalId= )
  4. highlight and Cut this text
  5. type a friendly name for the hyperlink (example:  "Copy this result")
  6. highlight that friendly text and click the link button
  7. Paste the Cut URL
  8. click OK
  9. drag the text pop-up element to the top of your pop-up

This will create a clickable link in the pop-up of whatever survey result your click in the map.  It should open that result in COPY mode, effectively copying the location (and all attributes) to a new survey result upon submission.  If new results are on null island (0,0), ensure the geopoint question is visible in your survey, and read-only if you don't want the point location to be editable.

ToddW_stl_0-1725459163297.png

 

0 Kudos
RichardPasquale
Emerging Contributor

This community always AMAZES me. Thanks to y'alls responses I was able to figure out a way to make this work.

RichardPasquale_0-1725549466287.png

and I used an URL link of: 

https://survey123.arcgis.app?itemID=d9eb2d2764c54c6a8a4b245f64bc5b42&field:SUID={SUID}&field:PlotID=...}&center={Lat_Y},{Long_X}&field:DateCompleted={DATE_COMPLETED}&field:MarcoPlotSize={MacroPlotSize}

Any idea if a geopoint field that is "required" can have a constraint or apperance or some setting so that if, no value is present the user will see the question and be required/prompted to gather a geo location using the map/location services AKA as normal operation would work. BUT if the Y, X value was auto populated from the URL lik call-up the user would not have the ablilty or would have an additional step to change the geo location?

I think I'm I'm trying to say, if the call-up returns NULL then allow view/map location selection and require , if call up returns a value ${geopoint field} apperance is hidden and required

I'll keep sluggin away at calling up values from the attribute field to a select_one field......

RichardPasquale_1-1725549670152.png

It looks to me like the mode=copy will get me where I need to be since i'm calling on the same form, I'm just coping field X from form A to field X  on a blank form A.

 

Thanks again, and the links provided are really helping me grow in this space.

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

That is a tough one.  I am not sure if read only works on a geopoint question?  If it does I could see also passing in the lat long as string fields then check those fields in the read only for null.  Note read only defaults to yes but you can add a formula there.

So something like ${PassedinLat} != '' and ${PassedinLat} != '' 

If not this formula in the esri hidden column could work as that just hides the question.

Or we have done stuff like Do you need to override the location? as a question and use that in read only.

0 Kudos
ToddW_stl
Esri Contributor

Thanks for the help with this one.  FYI, at least in a survey in a web browser, readonly does work on geopoints.  If my memory is accurate, the map did not respect the readonly setting in the Survey123 Field App, which is one reason we switched to the web.

ToddW_stl_0-1725555500737.png

Are you also saying you HAVE had success with formulas in the readonly field?  I feel like I didn't have any luck a few months ago, but maybe I'll retest.  I also had tried the various ways of hiding the map question (appearance, esri::body::visible) in certain cases for copy mode, but it always put my new point at (0,0).  We have 2 version of our survey, one to submit new, and one to edit, and the map is readonly in the Edit form (where we provide a link for the triage team to copy, if desired).

0 Kudos
DougBrowning
MVP Esteemed Contributor

Yes in Connect we use formulas in the Read only column on the regular.  If I remember a calculation in there can get funky since it thinks the data cannot change so it does not always fire the calc.

I don't use the web app much so I am not sure.