Have an idea?

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

Free Format Questions Design

Pulling label from a table that was designed by free format to display to  next question.  example: [% LABEL("q8_r3") %]
or could I use this one - [% Begin Unverified Perl
If value("q8_r2_=1") return "tell me why you mark" LABEL("q8_r2")
End Unverified %]
asked Jun 8, 2016 by SOC
edited Jun 8, 2016 by Walter Williams
Sorry, I'm not entirely clear on what the problem is.  Can you expound a bit more about what you want the second page to show?

A quick note about FF questions in case you are unaware: free format responses are referred to differently than in grid questions.  Most free format responses are gotten like so:
LABEL(FreeFormatQuestionName_VariableName)

Checkbox free format variables are gotten like this:
LABEL(FreeFormatQuestionName_CheckVariableName_1)

If your free format variables are named "r2" and "r3," then you're good to go.  If not, you'll need to replace "r2" and "r3" with what the variables are named.

One other quick note: whether or not you need quotation marks around question names depends on whether or not you are using unverified Perl.  Here's an example:

[% LABEL(SelectQ) %]

[% Begin Unverified Perl
return LABEL("SelectQ");
End Unverified %]
I have a table with 2 rows, the first row states something like "I need help with this task" and row 3 states "I can do this task alone".  Now they can select up a radio button under 1 - 4 column.  If they select in row 2 the answer under column 1, I want the following question to pull up the row label that states "I need help with this task".  Thus on the following question you would see  this statement "You have selected "1 Least Likely" for the task "I need help with this task" what made you rate this task this way? - this is what I am thinking of.
Alright, here's what I've got so far.  Your free format question has a table with two rows and four columns.  After the free format question, you want four open end questions.  Each open end questions should read to this effect: "For COLUMN A, you chose 'need help'" or "For COLUMN A, you chose 'alone'".

Is this right?  I'm not sure where the "Least Likely" stuff comes into all of this.
Yes here is what it looks like:
        Coloumns: 1-Highest 2 3 4 5 6 7 8 9 1- Lowest
Row1: Adaptable: Quickly adapts to new situations and requirements                     
Row 2Collaborative: Knows how and when to involve others in decision-making                  
--If they choose row 1 and select the first column then on the following page it need it  to tell me the label of row one.  

When I program it , even when not using free format, I indicate Label(q8a_r2_c1) but the program doesn't recognize any rows but the row contain the column labels.

1 Answer

0 votes
It sounds like you've tried to do this with both a grid question and a free format question, so I'll try to offer my help with both routes.

-- GRID QUESTION --

When you do this with a grid question, make sure to set "Question Direction" to "Columns."  This setting can be found in the grid's "Format" section.  Then you can access the row labels with a bit of SSI Script; for example, this code will print the labels of the row for the four columns:

Column 1: [% Label(GridQ_c1) %]<br>
Column 2: [% Label(GridQ_c2) %]<br>
Column 3: [% Label(GridQ_c3) %]<br>
Column 4: [% Label(GridQ_c4) %]


There's no "_r1" stuff because we're using radio buttons.

-- FREE FORMAT --

To do this the free format way, I started by creating a free format question and giving it four variables.  I set each variable's "Variable Type" to "radio."  Then I gave the free format this HTML:

<table>
    <tr>
        <td>
            &nbsp;
        </td>
        <td>
            Column 1 header
        </td>
        <td>
            Column 2 header
        </td>
        <td>
            Column 3 header
        </td>
        <td>
            Column 4 header
        </td>
    </tr>
    <tr>
        <td>
            Row 1 label
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column1, 1) %]
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column2, 1) %]
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column3, 1) %]
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column4, 1) %]
        </td>
    </tr>
    <tr>
        <td>
            Row 2 label
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column1, 2) %]
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column2, 2) %]
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column3, 2) %]
        </td>
        <td class="input_cell clickable">
            [% RadioSelect(FreeFormatQ_Column4, 2) %]
        </td>
    </tr>
</table>


Then on the next page, I used this code to display the row label of the first column:

[% Begin Unverified Perl
if (VALUE('FreeFormatQ_Column1') == 1) {
    return 'Row 1 label';
}
else {
    return 'Row 2 label';
}
End Unverified %]

In the two above codes, "FreeFormatQ" should be replaced with the name of the free format question, and "Column1" through "Column4" should be replaced with the names of the free format's four variables.
answered Jun 9, 2016 by Zachary Platinum Sawtooth Software, Inc. (79,700 points)
That didn't work - is there a way in which I can send the ssi file, out of the forum thus you will understand what I am asking?
Sure.  My work email is just my name at sawtoothsoftware.com.
sent the file to  - I used your first name and company.
...