Select to view content in your preferred language

Repeat records created dynamically AND POPULATED from previous question selections

243
3
2 weeks ago
Status: Open
Labels (2)
LindsayRaabe_FPCWA
MVP Regular Contributor

Problem: In Survey123, we have use cases where using a select_multiple question, the user checks all relevant categories that we need to detail in the repeat, but currently there's no way to dynamically create a record for each selected value in the repeat - only the total count of selected values. 

Idea: Include functionality in Survey123 Connect so that a repeat can have records pre-created AND pre-filled from a select_multiple question outside the repeat. For example:

LindsayRaabe_FPCWA_0-1776666457717.png

 

Use Case: Enforce rigid data practices so that all required records are captured with no reliance on the user ensuring that they manually add enough repeat records or selected the correct types for each category that needs detailing. 

3 Comments
AlfredBaldenweck

This is another case where S123 really needs a list or array data type.

We have multiple workflows where we end up creating a repeat record for each thing selected, but it's incumbent on the user to remember which record is for what OR on the form author to create a separate repeat for each value. This is kind of gross. (That being said, I think you could get around this by copying the values from each value repeat into a final, cumulative repeat and then get rid of the others? Idk, can you set repeat types to bind-esri-null?)

Having S123 do it for us would be sweet.

Neal_t_k

@LindsayRaabe_FPCWA Maybe I am missing something.  Can't you use selected-at(${multi-select question}, pos(..)-1) to get that repeat question to prefill appropriately?

LindsayRaabe_FPCWA

Thanks for the tip - got it to work using the below:

typenamelabelappearancerequiredreadonlycalculationrelevantchoice_filterrepeat_count
select_multiple a_iRelevant_AIs<b>What unintended and intended Actions & Inactions (A&Is) were evident?</b> yes     
calculatetotal_aistotal_ais   count-selected(${Relevant_AIs})   
begin repeatActions_Inactions_AIsActions & Inactions (A&Is)</b>minimal   count-selected(${Relevant_AIs}) > 0 and not(selected(${Relevant_AIs}, 'None')) ${total_ais}
calculaterec_ais_numrec_ais_num   position(..)   
noterec_ais_note_people<b><font color='red'>Record ${rec_ais_num} of ${total_ais} (Complete for each A&I listed below)       
select_one a_iAandIActions & Inactionsminimalyesyesselected-at(${Relevant_AIs}, ${rec_ais_num} - 1)selected(${Relevant_AIs}, name) 
textAandI_descriptionDescription yes     
end repeat         

 

LindsayRaabe_FPCWA_0-1776734568865.png