Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Create a constructed list from a grid question with constructed row list

I'm trying to code 3 questions into Sawtooth, maybe easier to understand if I just show you here:

[QUESTION: QOne]
[TYPE: SELECT | CHECKBOX ]

Which of these are you aware of?
Please select all that apply.

1.    A
2.    B
3.    C
4.    D
5.    E
6.    F
7.    G
8.    H
9.    I
10.    J
11.    K
12.    L
13.    None of these

[PAGE BREAK]

[QUESTION: QTwo]
[TYPE: GRID | RADIO | REQUIRED ]

Do you currently use, or have you previously used any of these devices?
[ROW LIST]
Constructed list from QOne – AIC(QOne)
 
[COLUMN LIST]
1.    Yes, I currently using it
2.    Yes, I have used in the past  
3.    No, I’ve never used it

[PAGE BREAK]

[QUESTION: QThree]
[TYPE: GRID | RADIO | REQUIRED ]

How do you have your current devices?
[ROW LIST]
All the currently using devices from QTwo

[COLUMN LIST]
5.    I rent it from friend
6.    I paid for it
7.    I got it as a gift


So question is
1. How should I build the row list for QThree?
2. If I need to ut HTML code, where should I put? In the List or the question?
3. If I need to ask will they buy a new version soon for each currently using devices, how to set up the skip logic?

Thank you very much in advance!!
asked Jul 8, 2021 by Jasmine (220 points)

1 Answer

+1 vote
For Q3RowList, if you want the list to be any that select 'Yes, I currently use' you would just create a constructed list with AIE (Q2, 1) as the list logic using the Parent list from Q1.

Does this give you what you need?
answered Jul 9, 2021 by Jay Rutherford Platinum (50,775 points)
Thank you for answering! But Q2 uses a constructed list, so I can’t use Q2’s list as parent list....
Correct, that is why I indicated to use the Parent list from Q1, but your logic for the constructed list would be AIE (Q2,1).  Your list at Q2 is also constructed based on the Parent list from Q1 so it all stems back to that.
Ahh got it, sorry missed that part, let me thry!
Works great! Thank you so much!!
Great!  Glad you got it sorted out.
Sorry one more question! If I want to add follow up question for each of the choices chosen 'paid for it' in Q3, what the code for skip logic? I tried AIE(Q3_r1, 1,3) not really working...
I figured it out! Thank you!
If you are looking to add a follow up grid question then you just need a new constructed list.  Looks like you were close!  It looks like 'I paid for it' would be option 2 in your Q3 grid.  So your constructed list logic for Q4RowList would be AIE (Q3,2).  You are creating a list of all the items that selected option 2 from Q3.  Just to confirm, I am assuming that at Q3 each row is a single response option.
Q4 will be a single select questions, so I used skip if Q3_r1= 1 or Q3_r1=3, it worked! Thank you!!
Great!  I'm assuming then you programmed multiple versions of Q4 (one for each possible response from Q3.  

In the future, as another alternative in your bag of tricks, what you could do to save some scripting in the future is to program Q4 once and then use the Q4RowList (which could be named differently) that I mentioned before to run a loop at Q4.  You would go to the Write Questionnaire area and click the Looping button on the right.  Click 'Add' and then give the loop a name (say Q4Loop).  Select Q4RowList as the List.  Make Q4 the Anchor Question 1 and also the Anchor Question 2 and click 'OK'.  This will now bring up Q4 one time for EACH answer choice that qualified for Q4 from the Q3 response.  If you are showing the text of that item in the question text you can just add [% LoopLabel() %] and that will show the text of the current item being asked about.  Give it a try and I'm sure you will find loops extremely useful.

Feel free to ask any additional questions you need as we are all here to help each other out.
That's a genius way to do it!! It is extremely useful !! So easy and so useful!!
Glad you find that useful.  If you use that, when you look at your data Q4 will be separated by dot notations (Q4.1, Q4.2, Q4.3, etc.).  Each dot notation represents the list order from your master list.
...