I would like to have a series of questions that have a Pass/Fail option that when Pass is chosen, a record is added to a repeat (related table).
My goal is to make each Pass or Fail question become one record in a table. If I have 10 Pass/Fail Questions and the operator selects all 10 as Pass, the resulting table will have 10 entries, each entry will be the Question and the status (pass/fail).
I can not figure out if this can be done using only Survey123. I have tinkered with GeoEvent too but that will not handle attachments.
Any suggestions?
Hi Tucker,
Just to be sure, you're wanting to transform (simplified example with 2 questions):
Name | Q1 | Q2 |
---|---|---|
Alice | Pass | Fail |
Bob | Fail | Fail |
Cathy | Pass | Pass |
into:
Name | Question | Result |
---|---|---|
Alice | Q1 | Pass |
Alice | Q2 | Fail |
Bob | Q1 | Fail |
Bob | Q2 | Fail |
Cathy | Q1 | Pass |
Cathy | Q2 | Pass |
?
If that's the case, the simplest way to do this in Survey123 would be to structure the form as a repeat, with any data that is uniform for the survey (like 'Name' in the table above) being entered before the repeat and then be placed into the repeat using a calculate question.
That being said, my normal instinct would be to manipulate the first table (one row per measurement) in the database after submittal. A couple of ways to do this - the 'Transpose Fields' tool in ArcGIS Desktop can do this to create the new table out. The appropriate SQL command is UNPIVOT (see the bottom example of Using PIVOT and UNPIVOT ), which could be used to make a view of the original table.
Thanks James, you are understanding me correctly. I will look into these options, thanks for your help!
James,
I like the repeat idea. One hurdle I am experiencing is that the calculate option calculates all related fields based on whatever is last selected. As you select another Name to populate a repeat row, it updates all the records in the repeats with that name...
Ah- I hadn't realized that the name would change- I was assuming 1 survey form per person.