Professional > Interview scripting > Writing interview scripts > Repetitive actions in the routing section > Object collection iteration
 
Object collection iteration
To repeat an action such as an assignment for all elements in an object
Include this notation at the appropriate place in the statement.
Object[..]
Examples
UsageLoop[..].TimesUsed.Response.Default = 0
This sets the default response for every repetition of the TimesUsed question in UsageLoop.
FavoritePicture.Categories[..].Style.Control.Type = ControlTypes.ctButton
This statement is related to a question (FavoritePicture) whose responses are images rather than texts, and sets up the question so that the respondent clicks on an image to select it as the answer to the question. The object reference is hierarchical, and refers to the control type for the style of every category within the FavoritePicture question object.
You can restrict the items within an object that a statement refers to as follows:
Object[.. In Object2]
A typical example is when you want to ask questions in a loop only for responses mentioned at a previous question. To ask respondents to rate each product that they tried, you could type:
ProductsTried.Ask()
RatingLoop.Categories.Filter = ProductsTried
RatingLoop[.. In ProductsTried].Ask()
For more information, see Asking repeated questions.
See also
Repetitive actions in the routing section