survey123 url field app not populating values from Field Maps on mobile (iOS or Android)

1811
11
Jump to solution
02-02-2023 12:45 PM
ARyanWADNR
New Contributor III

Hi All,

I have set my ArcGIS Field Map form so that the Pop-up uses custom URL calls to Launch the field app for Survey123 with pre-populated answers. Somehow, only the hard-coded values are actually coming through and none of the variable values. Strangely, these are working perfectly on PC with the Survey123 app launching from the webmap viewer. Is there something with the url set up that I am missing? or is this maybe a data issue?

Here is an example of the URL code I am using:

 

arcgis-survey123://?itemID=---------------------------------------&field:TrappingArea={TrappingArea}&field:ManagementArea={ManagementArea}&field:SiteLocationGeneral={SiteLocationGeneral}&field:TrackingDayInWater={Trap1}&field:TrackingDateFromFieldMaps={Trap1Date}&field:TrapNumber=1

I am using a hyperlink with a text object in the pop ups to do this. I have tried encoding the url with no success (using an online encoder, not the arcade function), and have tried to use arcade functions and the UrlEncoder, but have always received an error. The error given is "invalid variable assignment" for the UrlEncode parameters.

Are there other ways to build the custom url for field maps that will launch the survey123 field app on mobile?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
ARyanWADNR
New Contributor III

Well, I figured out a solution, although I don't actually understand why it works. Once I set all of the survey questions being populated from Field Maps to 'Read Only' the values started appearing.

I am thinking this is just a strange visual bug since the values were always there, just not visible.

Thank you @Katie_Clark and @DougBrowning for all of the help!

Andrew

View solution in original post

11 Replies
Katie_Clark
MVP Regular Contributor

What does the data look like that you're trying to pull in? I had issues with this the other day, where it worked on PC but not iPad. The facility ID's all had a pound sign (#) in front of all the ID's, when I removed that, it worked.

One thing I would recommend for testing is to remove all of the variables you're trying to populate and add them in one at a time. This can help you isolate if there's one particular field/data type that's causing the issue.

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
DougBrowning
MVP Esteemed Contributor

I agree this smells like a special character issue.  I am also not sure on just sending a 1 there.  

Post a actual URL that is failing.

0 Kudos
ARyanWADNR
New Contributor III

Interesting. Ive gone through each parameter I am trying to send, and have only had luck with values that are hardcoded (like the "TrapNumber=1"). I realized that TrapNumber is an integer field, and not a select_one or select_multiple. Would that make a difference?

I also removed the date parameters since those are the only parameters that might have special characters. All the other params are either integers or strings.

I am not sure what you mean aobut an actual URL that is failing. Other than the itemID this is my lauch url. Am i missing something even more basic?

Thanks!

Andrew

0 Kudos
DougBrowning
MVP Esteemed Contributor

That is not the actual URL, the real URL would have the actual values in it not the field names.  Something is getting messed up and that will show us.

You could also start with just one field and work your way up one by one to find it.

I have actually never tried to send a hardcoded value I think so not sure.

Is this new or old map viewer?

0 Kudos
ARyanWADNR
New Contributor III

Oh! Of course. Here is a string I get from the pop-up on the web map:

  • arcgis-survey123://?itemID=990d_____________________&field:TrapNumber=1&field:ManagementArea=Coast&field:SiteLocationGeneral=Willapa&field:TrappingArea=NemahR&field:TrapNumberText=1

Another potential complication that I just realized is that I am modifying the pop ups in the New Web Map. I don't know if I need to use classic, or more-likely, I don't have the map set up correctly in Field Maps Online. I haven't modified the pop up at all in field maps. Could that be an issue?

 

Thanks again. I really appreciate all of the work you put into helping others out on here. I also attached photos of the Pop-up setups for both the web map and in the Field Maps Online template app.

Andrew

0 Kudos
DougBrowning
MVP Esteemed Contributor

Well sorry but I see nothing wrong with this URL.  

I do not use new map viewer but adding a text element to the pop up then making a URL in there is the way to go.  You could try Classic just to rule that out I guess.

Are both your apps up to date?  

In your examples the date was blank.  Could that be it?

Sorry I am out of ideas now.  I use these URLs extensively and never had an issue so I do not know what is going on.   No Arcade involved just regular fields?

ARyanWADNR
New Contributor III

Thanks for all the help. It looks like the date wasn't the issue, but i found something even more weird.

If I click the link from Field Maps, and then submit the blank form that opens in the Survey123 field app, the values are still blank; however, if I submit the blank survey these values are part of the json and get recorded in the Feature Service.

This must be something in the mobile app it self. The values are there, just not visible.

I have tried it in Android, Survey123 version 3.16.114, and in iOS version 3.16.114.

At least I now know the issue is not in the url string, but something with my survey/app.

Thanks again you all.

Andrew

0 Kudos
Katie_Clark
MVP Regular Contributor

Are you able to share the XLS form? Might be helpful with trying to help troubleshoot

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
ARyanWADNR
New Contributor III

sure! I attached the excel file that I am using to modify the form. I tested the xml for the form and it is valid, so it must be something to do with how I have the survey set up for 123.

 

0 Kudos