Have an idea?

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

Adding previous response to list item

I have an answer option with a specify textbox in Q10a.  In Q10b (built from a constructed list), I need to show the original answer option AND whatever was entered into the textbox.

Thought it would be something simple like this:
if(VALUE("Q10a1_r5")< 3){ADD("Q10aRowList",5).VALUE("Q10a_r5_other");}

but no such luck.

Any ideas?
asked Mar 28, 2017 by jas8278 Bronze (750 points)

1 Answer

0 votes
If you use simple SSI Script like AIC [e.g. AIC(Q1)], the other specify comment will be automatically inserted into the question using the constructed list.

If you are using Perl with conditions applied, you can use something like this demo ...
Begin Unverified Perl


  if (VALUE("Q10a_r5")<3)

End Unverified

Your code 5 in QList will be defined as [%Q10a_r5_other%] , not the Other (specify) you had it defined in the original list at Q10a.
answered Mar 28, 2017 by Paul Moon Platinum (81,475 points)
Doesn't this add the original answer option and the text they entered in the text box as separate responses in the follow-up question?

What I need is this:
Q10a_r5 = Would rather own than lease (please specify)

Q10b option 5 = Would rather own than lease (please specify) Because leasing is a waste of money

Where "Because leasing is a waste of money" is what they entered into the specify other text box
My example would only add the comment entered in the other specify box.

Example ...
If I had the Q1 list defined as follows ...

5-Other (please specify)

If I was to select the Q1 responses and display them at Q2, I could simply use this script in a constructed list ...


This would display all codes and the comment mentioned in the other specify box. So if I said Green / Orange / Other [Black], Q2 would display as follows ...


Now because you are using conditions within Perl, you will need to bring up the other specify comment by using the following parent list (call it ColourList) ...


And in your constructed list, you would have something like this ...
This constructed list would use ColourList as the parent list.
Begin Unverified Perl
  if [condition]
End Unverified

If you want to add any script to the comment, that's possible by re-defining code 5 in ColourList.

e.g #1
5-Colour mentioned: [%Q1_5_other]%]
This would display "Colour mentioned: Black"

e.g #2
5-You selected [%Q1_5_other]%] as your other colour
This would display: "You selected Black as your other colour"

I can check your ssi file if you need to send me an example.