Populate later answers based on previous questions

855
8
08-20-2017 06:28 PM
MatthewCobb
New Contributor

Here's the scenario:  Our field crews have to inspect a railroad crossing, and they need to perform the inspection from both approaches (northbound & southbound, for example).  I set up two groups, one for each approach, with the same questions.  Is it possible to auto-populate the second group with the answers that are entered from the first group?  This would save the crew time because the signage, lights, etc. are largely going to be the same on both sides.  I explored repeats, but this option is not practical for the end use as each approach needs to be it's own "form".  Thanks for any advice!

0 Kudos
8 Replies
JohnathanHasthorpe
Esri Regular Contributor

Hi Mathew

I would address this using calculations. Essentially you can use a calculation to update a question, based on the answre to a previous question. In this case it would work by updating the questions in the second group, with the answers from the first: 

The user completing the second approach (i.e the second group) can then override any questions if required.

I hope this is helpful.

John

MatthewCobb
New Contributor

Hi Jonathan,

Thanks for your reply.  Unfortunately, this does not seem to work correctly.  I followed the example in my form, but this not only doesn't pre-populate the second set of questions, it also disables the Relevant statements from the first set of questions.  

0 Kudos
MatthewCobb
New Contributor

I've attached a TEST xls form to highlight the error.  When the calculation info is removed, then the relevancy formulas work correctly.  But in its current state, they do not.

**EDIT**  I've found that this method does work with manual input fields (text, integer, etc.), but does NOT work with select_one field types. 

0 Kudos
by Anonymous User
Not applicable

Matthew, I believe the issues is that you are attempting to push a Select_One answer value into another Select_One question. If you were to change the second select one question to a text field to accept the first select one question then all functions correctly.

MatthewCobb
New Contributor

Thanks for the example and solution, Mike.  So, I'm guessing Survey123 doesn't support pushing the answer from one Select_One question into another Select_One?  I like your solution, and it would definitely work, but the majority of my choices domain codes are numerical (matching a pre-existing access database supplied by the client), so this would definitely cause some confusion for the field crews if they see a "0" instead of the word "NO".  

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Matthew,

Yes, currently select_one questions cannot be calculated.

MatthewCobb
New Contributor

Well dang, that's too bad.  At least I'll be able to populate the non-select_one fields with the previously entered data.  Thank you James, Mike, and John for your help.

0 Kudos
by Anonymous User
Not applicable

Matthew,

I wonder if you would be able to use some hidden note or text fields; I cannot remember which field type does not save the data entered into it when "Hidden", that are named appropriately to match the database schema and contain the number or "Code" portion of the domain. Then you could have a set of dummy questions that contain the "Text" or "Description" portion of the domain as answers for the field crews to see?

You would have to use some fairly complicated if() statements to do it or possibly external selects. I think the external selects would be easier as you could return the "numeric" or "Code" values into the hidden note or text fields, while the user is selecting the "Text" or "Description".

It would blot the database, but you could have a routine that would remove the extra fields after downloading.

Just a thought outside of the box.