Select to view content in your preferred language

Passing parameter via URL to Survey 123 working in Map Viewer, but not all parameters getting passed using Field Maps

242
12
Jump to solution
Sunday
MHCorvus
Occasional Contributor

New to Survey 123 here

I have a common workflow of creating a point using Field Maps and then having a URL in the pop up to connect to a survey 123 survey which fills in the related table. I want 6 parameters passed to the survey to be filled in upon opening

Everything works great using the browser and map viewer, but when I use Field Maps on my device, one of the parameters does not get passed, but the other 5 do.

Here is the link to open the survey 123 survey which also makes the pretty green button 🙂

<a target="_blank" rel="noopener noreferrer" href="https://survey123.arcgis.app?itemID=8474e70272ed47259b15a13793ac1e05&amp;field:ParentGlobal={GlobalI...}"><img src="https://dabuttonfactory.com/button.png?t=Open+Survey+123&amp;f=Roboto-Bold&amp;ts=24&amp;tc=fff&amp;..." alt="Open Survey 123"></a>
</p>

ParentGlobal, Wayp;oint, Parcel, Latitude, and Longitude all get filled in fine, but the Detectiontype field only gets filled in when I use the Map Viewer, not for Field Maps to the mobile Survey 123 app.

Here are the steps I've tried so far.

1. Making sure both Field Maps and Survey 123 are updated to the latest versions on the mobile device

2. Clearing the cache on both mobile apps, reloading the map in Field Maps, updating the survey in survey 123

3. Taking out the extra code in the URL to make it a simple link

4. Checking the field names to make sure they match.

Again, link works fine on my computer working from Map Viewer, all 6 fields are populated fine, but on the mobile device using Field Maps, Detectiontype does not get filled in. This was a field I added after the other ones, which is why I thought maybe it was a cache issue, but so far that hasn't helped. 

I am attaching the xlsform for the survey. 

 

0 Kudos
1 Solution

Accepted Solutions
MHCorvus
Occasional Contributor

But that did the trick.

I just had to add an attribute expression to pull the DomainCode for that PTType field and use it in the URL instead of the field itself.

I will repeat the link to the post I ended up using. I had to do it even though the labels and codes were the same in both my feature class and survey 123 field, so it seems that fieldmaps is just using the labels

https://community.esri.com/t5/arcgis-field-maps-questions/url-passing-labels-not-coded-values-to-sur...

View solution in original post

0 Kudos
12 Replies
DougBrowning
MVP Esteemed Contributor

When I copy the link the last } is missing.  Also not sure all the amp stuff is there.   Just &field:EvaluationID={expression/expr0} works for me.

ps://survey123.arcgis.app/?itemID=8474e70272ed47259b15a13793ac1e05&amp;field:ParentGlobal={GlobalID}&amp;field:WaypointID={WaypointID}&amp;field:Parcel={Parcel}&amp;field:Detectiontype={PTType}&amp;field:Latitude={expression/expr1}&amp;field:Longitude={expression/expr0

0 Kudos
MHCorvus
Occasional Contributor

I'm not sure why that is but this is the plain text version of the more simplified URL. Maybe there was an issue with pasting it as a link into this forum or I'm missing something which is also totally possible.

 

<p>
<a target="_blank" rel="noopener noreferrer" href="https://survey123.arcgis.app?itemID=8474e70272ed47259b15a13793ac1e05&amp;field:ParentGlobal={GlobalI...}">OPEN SURVEY 123</a>
</p>

 

The the Detectiontype triggers the appropriate survey questions to open so it would be really nice to have that come across. Our field folks complain bitterly if they have to enter twice

 

0 Kudos
MHCorvus
Occasional Contributor

Nope still not bringing through the whole thing. Not good at these forums

0 Kudos
DougBrowning
MVP Esteemed Contributor

I would double check the spelling and the case

Detectiontype={PTType}

0 Kudos
MHCorvus
Occasional Contributor

Yep would have thought that too but to me they look correct--here are the screenshots. Again it wouldn't make sense that it works with the Map Viewer if the names were wrong.

 Screenshot 2024-09-23 124120.pngScreenshot 2024-09-23 124306.png

0 Kudos
DougBrowning
MVP Esteemed Contributor

Why is SensitiveSpecies highlighted?  That usually means a dup field name.

Detectiontype is a select one.  Do the values of PTType line up with the name column of the choice list?  (not the label column must match name column)

0 Kudos
MHCorvus
Occasional Contributor

I appreciate your help with this it seems like it is something so simple and it is nice to have fresh eyes. To answer your questions

Sensitive Species is the name of the Group. I named the Begin Group and the EndGroup the same because that made sense to me. Shouldn't affect anything since those fields don't collect data, but I can change those

Yes the coded values for the feature class are the same as the coded values for the survey 123 survey. I have double and triple checked that.  

So I checked if I could use my mobile device and use the browser and Map Viewer to open the mobile version of Survey 123 and that works fine--all fields populate. So it is just unique to Field Maps (not the mobile version of Survey 123 or anything)  

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

Only other idea is special chars.  Maybe post up some values.

0 Kudos
MHCorvus
Occasional Contributor

Ok 

So I edited the URL so it only included the PTType. Still works in Map Viewer, not in Field maps. So then I hard coded a value so Detectiontype=SS. That works in field maps

Then I added an Info field to the form that just contains the value from the PTType field--in the Map Viewer version it returns the Code for that field which is the value I want for Survey 123. In the Field Maps version it returns the Label instead. So my guess is that what is happening in Field Maps the URL is trying to pass the label to survey 123. That is super frustrating and counterintuitive. Anyone know a way to force it to use the coded value?

 

0 Kudos