Have an idea?

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

Piping Row Name into multiselect grid from another multi select grid choice

So I have one multiselect grid from which I would like to pull the selected rows from to pipe into another multiselect grid row list regardless of which column they were selected in. I know I have to use Perl script, does anyone know the specific script?
asked Sep 14, 2018 by anonymous

1 Answer

0 votes
Please try this constructed list instructions:

Begin Unverified Perl
my $gridQ = 'GridQ1';
my $rowList = 'GridQ1RowList';
my $colList = 'GridQ1ColList';

for (my $r = 1; $r <= LISTLENGTH($rowList); $r++) {
    my $selected = 0;
    for (my $c = 1; $c <= LISTLENGTH($colList); $c++) {
        if (GETVALUE($gridQ . '_r' . $r . '_c' . $c)) {
            $selected = 1;
            last;
        }
    }
    if ($selected) {
        ADD($rowList, $r);
    }
}
End Unverified


Line 2 must be updated with the name of the first grid question.  Line 3 must be updated with the name of the first grid's rows list / this constructed list's parent list.  Line 4 must be updated with the name of the first grid's columns list.
answered Sep 14, 2018 by Zachary Platinum Sawtooth Software, Inc. (120,175 points)
...