In this article
Code masks are used to filter the answer lists of 3D-grids, grids, single, multi, ranking, open text list and numeric list questions, and to select a set of iterations for a loop. In the Code mask field on the Script tab of a question details page, or in the loop construct (go to Creating a Loop for more information), use a JScript or JavaScript expression that evaluates to a set of codes. The answer list (or loop member list) will be filtered based on the set of codes in the Code mask field.
Important
In a grid, it is not recommended to use triggers to re-mask the current/same question. If the grid is masked on itself using a trigger, then any data entered in the masked answer may not be saved.
Code Masking In a Loop
Code masks are used to select a set of iterations for a loop. To set up a code mask:
In the Code mask field on the Loop node's Script tab, input a JScript or JavaScript expression that evaluates to a set of codes. The loop member list will be filtered based on the set of codes in the Code mask field. A simpler method in Survey Designer is to use the “Dynamic answers” functionality in the “Iteration items” section for the loop. Choose Actions > Add dynamic answers, then from the drop-down, choose the question you want to filter “Iteration values” on. Code Mask can still be used as an alternative.