Skip survey header

"Pipe" from a Table

Original Table

Example Script

The below script pipes the table question titles for all the rows that are rated either 4 or 5 on the previous page into this table question.

%%original_table = sgapiGetTableQuestionTitles(51);
%%followup_table = sgapiGetTableQuestionTitles(61);
%%row_to_hide = array();
foreach(%%original_table as %%row_id => %%row_title)
{
  if(sgapiGetValue(%%row_id) != 4 && sgapiGetValue(%%row_id) != 5)
  {
    %%row_to_hide[] = %%row_title;
  }
}

if(sgapiCount(%%rows_to_pipe) == 0)
{
  sgapiHideQuestion(61,true);
}
else
{
  sgapiHideQuestion(61,false);
  foreach(%%followup_table as %%row_id => %%row_title)
  {
    sgapiHideQuestion(%%row_id,false);
    foreach(%%row_to_hide as %%title)
    {
      if(%%title == %%row_title)
      {
        sgapiHideQuestion(%%row_id,true);
      }
    }
  }
}

Original Table

1. Please rate the following games on a scale of 1 to 5, with 1 being terrible and 5 being awesome. On the next page, we will "pipe" (or repeat) only the rows for which you answer 4 or 5.
Space Cell Terrible
1
234Awesome
5
NA
Tetris
Donkey Kong
Super Mario Brothers
Space Invaders
Pong
Solitaire
Minesweeper
Snake
Frogger