# How do you randomly assign different scenarios to survey population using a grid question?

I have built out 10 scenarios, and before each respondent sees the scenario we ask them on a scale of 1-5, how comfortable are they with each scenario we are going to ask. If a respondent chooses a 3,4, or5 they should see the questions related to the scenario, however, we want to limit the number of scenarios seen to 3. How would we randomly assign the scenarios based on the response to the grid question if someone for example rated all scenarios with a 3 or above?

You can create a constructed list and in combination with some skip logic, you have a solution.

Let's assume your grid question is Q1.

Create a constructed list (call it ScenarioConList) as follows ...
```AIG(Q1,2)
Randomize()
ListMax(3)
```

This constructed list should use the same parent list as the row list in your Q1 grid question (the 10 scenario's). It will select all scenario's where they were coded as 3-4-5, randomise them and trim the list down to 3 scenario's maximum.

You can use skip logic as follows ...

Examples for scenario 7:

Ask if: ListValue(ScenarioConList,1)=7 or ListValue(ScenarioConList,2)=7 or ListValue(ScenarioConList,3)=7

Another option is ...

Just a final comment: You can apply other features in a number of ways like least fill or prioritise scenario's in situations like this.
answered Oct 14 by Platinum (84,255 points)
Thank you! So each scenario is spread across 4 pages -- is this an issue? Also, for the skip logic, does this get added as a "post-skip" to the grid question? Also, not sure where the constructed list would be used .. assuming not in the grid question?

Thanks again!
That's okay that each scenario takes up 4 pages each. You just need to set your SKIP TO questions accordingly.

I'll use this example to guide you with the skips ...

Scenario #1 asks Q11-Q14, use a pre-skip with skip-to=Q15
Scenario #2 asks Q15-Q18, use a pre-skip with skip-to=Q19
Scenario #3 asks Q19-Q22, use a pre-skip with skip-to=Q23
and so on for all 10 scenario's ...

Skip logic will be ...

Scenario #1 at Q11: Not(ListHasParentMember(ScenarioConList,1))
Scenario #2 at Q15: Not(ListHasParentMember(ScenarioConList,2))
Scenario #3 at Q19: Not(ListHasParentMember(ScenarioConList,3))
and so on for all 10 scenario's ...

The constructed list is to be created within the Lists section. See the Lists menu option at the top, click that on and then click on "Add Constructed List". Give the list a name, select the parent list and in the window insert that script I provided earlier.

Insert the pre-skips at the first question for each scenario (as described above).

Let me know how you go. Happy to provide additional assistance if necessary.

Paul.
Thanks so much! That was the missing piece. The survey seems to be functioning as expected. One last question, though. If we want folks to always see 3 tasks (if they qualify to see three tasks), does the coding in the constructed list allow for folks to maybe only see 1 or 2, but never more than 3.. any way to fix that so folks always see three if they qualify for three?
The scripting in the constructed list will find ALL scenario's that are rated 3-4-5 and add them to the list. It will then randomise them and then trim the list to a maximum of 3 scenario's.

If only 2 scenario's meet the condition, only 2 will be stored in the constructed list.

If only 1 scenario meets the condition, only 1 will be stored in the constructed list.

And if no scenario's meet the condition, none will be stored in the constructed list. This will make all scenario question sets to be skipped.

So this solution will work for 0 or 1 or 2 or 3 scenarios meeting the condition of being rated a 3-4-5 at your grid question.

I assume that is what you are seeking?

We can also change the programming in the constructed list if you wanted to apply priorities of certain scenario's. There's lots of power there.

I also encourage you to carefully test the survey and check some test data that your capture. When you do check the test data, look to the constructed list that is storing the scenario's that control your skips. It can be used in your final data to analyse your reporting. You can export constructed lists as you do variables.
Thank you! This was super helpful.
Glad to hear it guided you. Hope to hear from you again soon on the forum.
One follow up question. We now need to program the survey that folks need to be at least somewhat comfortable (3, 4, or 5 - note asked using a grid question) with at least 5 scenarios to be entered into the survey. If they are not comfortable with at least 5 scenarios they should be DQ. Any thoughts on how this programming would work?
Hi Kaitlan. Just confirming some of the details here.

So you want the same conditions applied across all scenario's - only get those scenario's rated a 3-4-5.

But this time you want to include all scenario's rated a 3-4-5 without trimming down to 3 scenario's? If you need the respondent to have at least 5 scenario's meeting this condition of being rated a 3-4-5, then change your constructed list to ...
```AIG(Q1,2)
Randomize()
```

In skip logic, you can terminate if: ListLength(ScenarioConList)<5

So this method will now get all scenario's that have been rated a 3-4-5. If less than 5 scenario's have been rated a 3-4-5, the survey should terminate.

Now one query I do have: Do you still only want to ask questions for 3 scenario's or all scenario's rated a 3-4-5?
If you only want to ask for 3 scenario's, then use this skip logic that I provided earlier ...

Examples for scenario 7:

Ask if: ListValue(ScenarioConList,1)=7 or ListValue(ScenarioConList,2)=7 or ListValue(ScenarioConList,3)=7

Let me know how you go.