Logo Help Center
Chat with us
Open a ticket
Sign in
  1. aytm Help Center
  2. aytm Logic
  3. Using aytm Logic

Articles in this section

  • aytm Logic Reference Guide
  • Masking Logic
  • Custom Quota Logic
  • Terminate Logic
  • Examples of Custom Quota Logic
  • Scoring Logic
  • Nested Group Logic
  • Sort Logic
  • Exclusive Logic
  • aytm Logic: Sort by array
See more

aytm Logic: Sort by array

Preserve the sort order of items across questions or subquestions using a combination of Sort logic and Array logic. In this way, you can randomize a list of items across respondents, while preserving the order within a single respondent's survey.

 

1. Create a reference array

In any question that appears before the list of items, add array logic, including the item numbers of all answer options or subquestions you would like to randomize. Note that you must write out all numbers you'd like to include separated by commas (rather than using a range). 

In this example, the word activities is the name of our array that we will use as a reference in later logic. Give your array a name that makes sense to your list of items.

Ex:

[activities << 1,2,3,4,5,6,7,8,9,10,11,12,13]
Snag_111309a8.png

Learn more about arrays.

 


 

2. Add the shuffle command

In order to randomize the list (per respondent) we'll also randomize the order of the numbers that were added to the array. We can accomplish this by using the array name, and the shuffle command. This command must come after the array is created, and before the array is used in other logic. 

Ex:

[activities = shuffle activities]
Snag_11136c98.png

 


 

3. Use Sort by logic

Within the question text of the desired question, add Sort by logic, where the reference is the question and list you wish to sort, and the order to sort is the (previously shuffled) array name. If the list is a set of answer choices, use the reference A; if the list is a set of sub-questions such as within a matrix question, use the reference SQ. This will tell the system to enforce the shuffled order within the question referenced.

Ex:

[Sort Q2A by activities]
[Sort Q3SQ by activities]
Snag_1113b1de.png

 


 

4. General notes and reminders

As you sort by array, keep in mind:

  • This logic will not function properly if the Randomize box is checked for a question type.
  • This logic may be used in conjunction with Mask logic.
  • If your array does not contain all answer options within your list, the items that are left out of the array will appear in static order after the shuffled list.
    Ex: If your logic is [brands << 1,2,4,5,6] [brands = shuffle brands] and there are 8 answer options, your respondents will first see Answer options 1, 2, 4, 5, and 6 in a random order, followed by Answer options 3, 7, and 8 in static order.
  • Facebook
  • Twitter
  • LinkedIn
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Return to top
  • Our platform
  • Solutions
  • Pricing
  • Our panels
  • Help center
  • Contact us
  • Blog
  • Privacy
  • TOU
  • About
  • Careers
  • Innovation lab
  • Demo
© 2022, Umongous, Inc. All rights reserved.

zendesk theme design by aytm c/o diziana