Costume URL's not working in version 3

887
7
07-24-2018 01:37 PM
by Anonymous User
Not applicable

I just downloaded the latest release of Survey123, version 3.0.132, and noticed that the fields in my surveys that populate from the URL I use to open them are not populating. Was there a change in the way that the URL's need to be setup in order to pre-populate fields in my surveys? 

0 Kudos
7 Replies
by Anonymous User
Not applicable

Hi Andrew,

Can you provide an example of what your custom URL looks like? Was it working in 2.8 version of the app? And are you launching the url from Collector or another app?

Phil.

0 Kudos
by Anonymous User
Not applicable

Phil,

This is the URL we are using to launch the survey, our users are launching the survey from a popup in a web application. All of my users are on 2.9 and it is working for them. I installed 3 to start testing it and noticed this issue straight away, when I rolled back to 2.9 the surveys are opening with the fields populated. 

 arcgis-survey123://?itemID=52e8b01ceaab474189bcd9eec36f7bb4&field:Rel_GlobalID={GlobalID}&field:Project_Name={ProjectName}&field:Project_Num={ProjectNum}&field:UPC={UPC_Num}&field:VAR10_Num={DEQID} 

0 Kudos
by Anonymous User
Not applicable

Hi Andrew,

Are you able to test  with another survey in 3.0 that does not use underscores in the source fields or destination field names, basically try to remove all of the underscores you see in your URL? I am trying to work out what is breaking the URL in 3.0 and this could be a possibility?

Phil.

0 Kudos
by Anonymous User
Not applicable

Hi Andrew,

Further to my last comment I was able to successfully use a URL that has underscores in it and the values are passed to Survey123 correctly.

arcgis-survey123://?itemID=ecc2fca33d22403688c387bce216f4f1&field:SL_ID={OBJECTID}&field:Shape_Length={Shape__Length}

Are you able to provide a copy of your xlsx form so I can take a closer look into this issue?

Phil.

0 Kudos
by Anonymous User
Not applicable

Phil,

Here is a copy of my xlsx form, and the feature service I am submitting to. 

I tried using a URL with no underscores and it did populate the fields in my survey. ( arcgis-survey123://?itemID=4c101b5e5a4a4b599d846872ba16f0fb&field:incoming={GlobalID} )

0 Kudos
by Anonymous User
Not applicable

Hi Andrew,

Thanks for sharing your xlsx file and fgdb. Good news, I was able to replicate your issue and narrow down why you are not seeing the values being passed into your survey from the custom URL.

I can see that the fields you are trying to pass the values into are not relevant when the form loads, as you are using relevant statements based on the select one question. This means those fields will not store a value until they become relevant. In version 2.8 and earlier, we used to allow values to be stored in non-relevant questions which was incorrect, and the data would therefore be sent to feature layer if not relevant, which was also incorrect and reported as a bug by many other users. If the question is not relevant it should not have an answer. In version 3.0 we fixed this behaviour so that it now works as expected and values can not be stored in non-relevant questions.

Unfortunately in your case, due to the way the survey has been configured, it causes the values to now not be stored in those questions. Good news is that there is a way to set up your survey for this to work, and still have the relevant questions based on the select_one question. Create a set of hidden questions at the start of your survey and pass all the values from the custom URL into those hidden questions. Using calculations on your relevant questions you can get the values from the hidden fields and populate them into the relevant questions once they become relevant based on the select_one question being selected. I have tested this and it works as expected. Below is an example of all your custom URL values being populated into the survey from an AGO webmap.

On a side note, I see you have a label that states Temporary correction: If "%2c" appears in Project Name, Please replace it with , . This issue was fixed in 3.0 also, and special character values used in the custom URL (like a comma, space, percent, dollar etc) are now decoded properly when parsing the values into the survey. So you can test this out with you data and then remove that label if it's working ok.

Hope this helps and you can get your survey working the way you want it again.

Phil.

0 Kudos
by Anonymous User
Not applicable

Phil,

If I add hidden fields to the beginning of the survey I would have to add them to the feature service as well. Is there any way to avoid having to add these extra fields to my feature service and still maintain the same workflow for my survey? 

0 Kudos