Select to view content in your preferred language

Open a next survey as a result of a specific answer to a question

09-07-2023 08:38 AM
New Contributor II

Hi All, I'm trying to open a url based on a specific answer to a question is a survey. If the answer is "yes" (chosen from a select_one), a (url to a) next survey needs to be opened automatically. This survey needs to be opened with some specific parameters that are currently stored in a custom url that can be opened by cliccking on it in the first survey. But I don't want fieldworkers to click on it, I want them to answer the question and open the next survey automatically.


Can it be done?

Cheers, Jelle.

4 Replies
MVP Regular Contributor

Potentially, but would require custom scripts.

Honestly, that sounds like a lot of work for little reward. I'd suggest just making an obvious 'Click Here' link appear once all the necessary fields have been filled in.

The URL can be customized behind the scenes via calculates. Where are these URL parameters stored? Are they contained within the current survey? If yes, then pulling them into the URL is straightforward. If no, then you will need to pull them the server which is a little more work. Either way, it shouldn't be that hard, just something to think about.


Edit: Another thing to think about. But when they submit that new survey, they will be taken back to the previous survey (where they left off). This could potentially be confusing. I wish there was a way to exit and close surveys via URLs, like what you are describing... A potential workaround is simply have all the content of that second survey built into the first. So, rather than be taken to a completely new survey, you just dynamically show the content that they need.

New Contributor II

It wouldn't be 'little reward'. The first survey is generic, more like a workorder. It contains the url to the second survey, that is a more object specific survey. They can not be merged into one survey. But if the mechanic accepts the order, he needs to be forced to fill in the second survey. If he chooses not to accept the order, than the first survey will be closed and the second survey can be ignored. But how we have it now, is that he can accept the order (the first survey) and accidentally forget to fill in the second survey. So it would be very helpfull if the acceptance of the order directly opens the second survey.

How would such scripting look like?

0 Kudos
Occasional Contributor II

To add to what @abureaux was suggesting, if this question is "yes", does that mean they only need to fill in the second survey, or does the first one need to be filled in as well?

I don't have a solution to automatically open the survey, but I do have a possible workaround.

One thing I have done with my surveys is a "gateway" question. Below this question, I put the rest of the survey in a group. The answer to the gateway question(s) triggers the relevant for the group and (inversely) triggers a note with a link to the second survey. Then the only choice they have is to click the link and go to the second survey.

For an example, let's say you have two surveys: Survey1 (the main one) and Survey 2 (the secondary one). Survey 1 has Question X that, if yes, requires the user to fill in Survey 2. - I think this is your scenario.

The workflow goes like this: the survey goes along until Question X . After question X, there is a note with a link to Survey 2 (and some calculated URL parameters) - with a relevant statement [QuestionX='yes'] All questions after Question X are in a group. That group has a relevant statement that says [QuestionX="no"]. The answer to question X determines if they see the link to Survey 2 or the rest of Survey1.

If the first survey still needs to be completed either way, then Question X could just trigger the note. You could then have a second "gateway" question that is simply "Did you fill in Survey 2?" - if yes, the rest of the form shows, if no it hides the rest of the form with a default of "no" and a relevant statement that only shows this queston if Question X = 'yes'. This would mean that if Question X is yes, they have to return to Survey1, verify that Survey2 was completed, then Survey 1 continues. 

On a side note, I will sometimes have these "gateway" questions in fields with Bind::esri:FieldType = null. this way I don't clutter up my data with unnecessary fields, but that's a choice.

I hope that all makes sense to someone beside me. 🤓 To hopefully help, I attached a simplified sample that does what I'm describing.

Good luck and happy survey authoring!

0 Kudos
New Contributor II

This certainly makes sense, but the two surveys can not be merged into one unfortunately.

But you did bring me to some new ideas, I'm going to try something else. Thanks!