Loop

SKIP AHEAD TO
Designing a Loop
Referencing user inputs given during a Loop
Special Loop syntax
Use case for referencing Loop inputs

Loop.jpeg

Loops:

  • Show a set of pages to your user over multiple repeats
  • Are paired with Lists, where for each entry in a paired list, the pages in the Loop are run through once
  • Can collect the answers for each input field within a loop, and create a list of those responses for each input (using output sets).

 

Designing a Loop


To add pages to a Loop:

  1. Move page blocks into the Loop block area.
  2. Connect the page blocks inside your Loop to create the workflow for your user to loop through.
    Untitled_3.jpeg
  3. Under “Input Sets” in the Property Editor, enter the variable name for a List you want to reference. Add an additional input set per List.

    Loop_simple_input.jpeg

 

Referencing user inputs given during a loop


To reference the answers inputted into a particular input field throughout a Loop, create an output set.

Terms in the Property Editor

  • Variable REF: The field code for the input field
  • Condition: A filter for inputs given to an input field

 

Should I click Add variable option or Add output sets?

Each output set can only output the answers for a single input field. This means that all input fields that are certain to be answered in each loop should be given a unique output set.

Looking at the workflow example in Designing a Loop, for each loop, each input field will be visited, and so each should be given a unique Output Set:

OS_simple.jpeg

But, if in a group of input fields, one will always be missed for another, each input field in that group should be entered as variable options in a single output set.

An example:

Loop_mut_exc.jpeg

Because two mutually exclusive input fields branch out of the Yes/No block, only one input field can be answered in each Loop iteration.

So, reference these mutually exclusive fields as variable options in a single Output Set, which will take only the relevant input from each Loop iteration.

Mut_exc_prop.jpeg

 

Creating a Loop Output Set with a LIST variable

If a LIST is entered as the Variable REF for a particular Output Set, that Output Set contains a set of LISTs.

These Output Sets only be referenced in:

  • Tables
    • When referenced in a table, it will behave similarly to a list, however instead of each row showing a single item, it will display a list of items.
  • Document loops
    • Similarly, when reference in a document loop, each iteration will display a LIST from the Output Set.

 

Special Loop syntax


The following Loop-specific syntax can be used:

LP#_IND
Loop Index. This is a counter for the number of iterations a user has completed in a Loop.
LP#_SET
Loop Set. The variable reference format for a Loop Output Set.
LP#_SIZE
Loop Size. This displays the number of entries in a Loop's Input Set and, by extension, the maximum number of iterations that Loop can run through
LP#_VAL#
Loop Value. This displays the nth entry in a Loop's Input Set, corresponding to which Loop iteration the user is up to. For example, to display the 1st entry in the Loop LP3's input set, use LP3_VAL1.

The outputs described above can be displayed on pages by dynamically referencing the Loop syntax. Below are examples of what the outputs will look like:

{{LP#_IND}}*
If the user is completing the first iteration of the Loop, '1' will appear in place of {{LP#_IND}}
{{LP#_SET}}
The List generated by a Loop Output Set will be shown.
{{LP#_SIZE}}
If the List used in a Loop Input Set has 4 entries, '4' will appear in place of {{LP#_SIZE}}
{{LP#_VAL#}}*
If the user is in the second iteration of the Loop, and the second entry of the Loop Input Set is Apple, 'Apple' will appear in place of {{LP#_VAL2}}.

*Can only be referenced in pages inside of a Loop.

Screen_Shot_2019-08-08_at_10.46.45.png

Except for LP#_SIZE, Loop syntax can also be used when writing conditions.

 

Use case - Displaying inputs from loop iterations in a table


This allows you to let your user validate that their Loop answers have been recorded correctly.

Using the multi-path workflow above as an example, follow these steps to create a confirmation table:

  1. Connect a Table to the right of your Loop block.
    Loop_table.jpeg

  2. In your Table, enter headings corresponding to the title of input fields that you want to reference.
  3. Under each heading, dynamically reference the appropriate Loop Output Set.

    In_table.jpeg

The Table will have enough rows to the number of inputs in the set will dynamically generate, creating a complete validation table.

Shareholder_details.jpeg