Skip to main content

FV Kinesis Support

All the topics, resources needed for FV Kinesis.

FocusVision Knowledge Base

Looping

This feature was introduced in Survey v5.7+. It is not available in prior versions of Kinesis Survey.

1:  What is Looping?

Looping is an extremely efficient way to program large sets of similar or identical questions. Looping allows the programmer to repeat a question or group of questions for multiple iterations. First, create the question or questions you wish to repeat in a loop in the Survey Editor. Next, select the List Manager feature and create a list of items. Each list item represents a single iteration and can be used to display dynamic variables (such as brands or attributes) into the question content. The below example is a list of 3 items, which we'll use for our looping example.

 

A (Very) Quick Looping Tutorial

Once we've created our list of items, we can build the loop within the Survey Editor. Select the question or set of questions you wish to loop through, and click the Create Loop option .

Note that a loop label MUST begin with the letter "L", much like your question datapoints must always begin with "Q". Choose your list from the dropdown and click 'Create' and you'll be shown the Question Group and Looping properties:

Like Question Groups, loops support conditional statements, rotations, and all types of question validation. In addition, piping and special functions are available if the programmer needs to reference the current list item or loop iteration. Once you've configured the loop behavior, click save and you're done. The programmed loop will now appear in your Survey Editor as a bright yellow grouping, with a prominent "L" logo representing the loop:

2:  Conditional Looping

Conditional logic can be utilized in a loop to only show certain iterations. To do this, you must first create a Checkbox Question that appears on a separate page prior to the start of your loop iterations, and the response items to that question must be populated by the List Manager, using the same list items that make up your loop iterations.

Set the Loop Condition using the Checkbox question that uses the same list used in the loop.

3:  Looping Functions

Questions outside of a loop can reference a specific loop iteration using the getAnswer function:

getAnswer("QLABEL", "OPTIONAL_LOOP_LABEL", "OPTIONAL_NESTED_LOOP_LABEL");

If the question you need to reference is a checkbox one, you will have to use the getAnswerWithPosition function:

getAnswerWithPosition("QLABEL", "OPTIONAL_LOOP_LABEL", "OPTIONAL_NESTED_LOOP_LABEL");

getAnswerWithPosition returns an array that contains the selected ID's in QLABEL. For example, if QLABEL was a checkbox with three choice options and only the first choice was selected in the first loop iteration, the following call will return (1,0,0):

getAnswerWithPosition('QLABEL', 'LOOP_1');

To get the list choice text of the current loop iteration use the getCurrentLoopName function:

getCurrentLoopName('LIST_LABEL');

To get the number of iterations the respondent has seen, use the getCurrentLoopPrintOrder function:

getCurrentLoopPrintOrder('LIST_LABEL';

To get a stored response for a previous question within the current iteration, you can use the following example:

~Q1@L1_~L1:printorder~~

4:  Piping within a Loop

There are several ways to utilize piping within a looped iteration. To pipe the current choice item from your list into a question, simply pipe the list label you assigned when creating the loop. In the below examples, our list is labeled 'LOOP1':

Ex: ~LISTLABEL~

~LOOP1~ (List Label for Loop1, Current Iteration)

To pipe a datapoint from a looped question while in the same loop iteration, use the standard piping syntax:

Ex: ~DATAPOINTLABEL~

~Q1~ (Data for Q1, while in same loop iteration)

To pipe data from a looped question outside of the loop iteration, use the full datapoint label and specify the list label and iteration you wish to pipe:

Ex: ~QUESTIONLABEL@LISTLABEL_ITERATION~

~Q1@LOOP1_1~  (Data for Q1, Loop1, First Loop Iteration)

The position of the choice item within your list can also be piped using the following variation:

Ex: ~LISTLABEL:position~

~LOOP1:printorder~ (Display current number of iterations seen in LOOP1 list)

Conditional piping is also supported and can be used with the functions mentioned above, such as getCurrentLoopPrintOrder:

~getCurrentLoopPrintOrder('LOOP1')==1 ? "First" : "Next"~

See Piping Datapoints for complete details on how conditional piping works.

5:  Limitations/Considerations

Important: There are several limitations to using Looping in the 5.8 software.

  • A question loop may not contain a full or partial custom HTML range.
  • Datalabels for looped variables follow a specific naming pattern: datalabel@loopname_iteration. You cannot customize this naming convention and will need to take it into account if third party software does not accept ampersands for data labels.
  • Quotas and data filters cannot be used with looped variables at this time: while looped data can be used by way of the functions above in conditions and validation, it cannot currently be used outside of the survey for quota increments or data filters.
  • Limited data support for looped datapoints: Survey FrequenciesTopline ReportDrill Down, and Raw Data Exporter currently have access to looped datapoints. The following tools, however, do not yet support looped datapoints and cannot be used with looped question sets:
    • Charts & Graphs
    • Crosstabs
    • Advanced Crosstabs
    • Batch Update Data
    • Logical Data Filters
    • High Speed Data Filters


Our dev team will continue to monitor the use of looped variables and consider additional support for these tools in future builds.

  • Was this article helpful?