Populate Applicable Rule Violated

412
2
12-20-2021 04:33 PM
BattJones
New Contributor II

I'm converting a Word inspection form into Survey123 that has several sections with multiple Yes/No/NA questions each. 'No' answers relate to a rule/statute violation. The current inspection form has a bunch of VBA that plugs in the applicable rule/statute that is violated and creates a new row for a description of the violation and actions to remedy it.

I'm wanting to find the best way to replicate this behavior in Survey123, but am having difficulties in finding a good way to implement this. My less than ideal solution right now is a line item for each (see below). This doesn't seem super scalable/efficient as it will likely end up being 800+ rows.

  • select_one (Yes/No/NA)
  • Note (with rule/statute number)
  • Text (description of violation)
  • Text (description of remedies)

Is there a different way I can approach this? I've not found anything on if populating a repeat based on prior criteria is feasible or if JavaScript might be able to help.

 

Any assistance is greatly appreciated. Thanks!

0 Kudos
2 Replies
DougBrowning
MVP Esteemed Contributor

I would have a repeat and drop down box to pick from the 800 long list with type ahead.  Then the two comments fields in the repeat also.  That way they can add any number of violations.  Having 800 yes/no questions is for sure not the way to go.  The schema would be a mess.

If they want a summary page of all violations at the end that is easy enough to do with a join.

Same basic idea as my species list form below.

Hope that helps

Adding Species.gif

0 Kudos
BattJones
New Contributor II

Hey, @DougBrowning . I appreciate the response. I actually previously implemented your plant species suggestion above on another form and it works beautifully, so thanks for that one!

I had the same thought, but unfortunately I don't think it'll fit the bill unless I can add additional functionality to the repeat table. The way the Word doc functions now is that it identifies what rule/statute is applicable to the violation (if X Violation then Rule 1234 applies, if Z Violation then Rule 678, etc.) and then creates a new row at the bottom of each section for each violation/description/remedy.

0 Kudos