Desktop User Guides > Professional > Interview scripting > Writing interview scripts > More than one question per page > Changing which questions are asked
 
Changing which questions are asked
Pages can be used to group any set of questions onto the same page at the top level, but pages are not yet supported in loops. Instead, question filtering can be used to change the questions that are asked for each iteration of a loop.
As an example, based on the answer to the country question, you might want to ask a different set of address questions for each iteration of the households loop. If pages were supported in loops, the script might resemble the following:
Households Loop [1..10]
  Fields(
  Number Text;
  Street Text;
  CityTown Text;
  County Text;
  PostCode Text;
  State Text;
  ZipCode Text;
  ' UKAddr Page Fields(Number, Street, CityTown, County, PostCode);
  ' USAddr Page Fields(Number, Street, CityTown, State, ZipCode);
) expand;
However, given that pages are not yet supported within loops, the questions that are asked for the household loop can instead be controlled via question filtering. For example:
Dim HouseHold
For Each HouseHold in HouseHolds
If Country = {UK} Then
HouseHold.QuestionFilter =
        "Number,Street,CityTown,County,PostCode"
Else
HouseHold.QuestionFilter =
        "Number,Street,CityTown,State,ZipCode"
End If
HouseHold.Ask()
Next
See also
More than one question per page