When the alphabetize tag is used on a list, all list elements will be organized in alphabetical order.
set list: CITIES
alphabetize: y
1. Seattle
2. Los Angeles
3. Portland
4. New York City
5. Denver
6. San Francisco
5. Which of these cities have you visited in the past?
type: checkbox
optsfrom: CITIES
99. None of these {exclusive: y}
Details
- The
alphabetizetag accepts 'y' and 'n' inputs. -
alphabetize: yis the functional equivalent oforder: AtoZ(*). - When used at the list level with a set list, the alphabetized order applies to every question or table that uses the list. When applied inline at the question level, it alphabetizes the list elements for that question only.
- The
alphabetizetag can be paired with theanchordecorator to keep specific options anchored in their list positions. - The
alphabetizetag can also be used as a decorator or as a column header in a sheet to alphabetize collections organized by collection headers.
Tip! To list elements in reverse alphabetical order, use order: ZtoA(*).
Additional examples
Using 'alphabetize' at the question level
You can apply alphabetize: y directly to a question widget to alphabetize the answer options for that question only.
2. Colors listed in alphabetical order.
type: radioalphabetize: y
1. Red
2. Orange
3. Yellow
4. Green
5. Blue
6. Purple
7. Pink
Alphabetizing rows in a table
Similarly, the alphabetize: y tag can be used inline on a table. In the example below, note that the alphabetize tag is placed after the rows tag with a heredoc to clearly define which elements to alphabetize.
set list: CITIES
alphabetize: y
1. Seattle
2. Los Angeles
3. Portland
4. New York City
5. Denver
6. San Francisco
3. Which activities have you done in each city?
type: checkbox table
optsfrom: CITIES
rows:<<END
alphabetize: y
1. Fishing/Camping
2. Excursions
3. Museum visits
4. Horseback riding
5. Shopping
END
If you program a table with listcalls like rowsfrom and colsfrom and also want to alphabetize options at the question level, use roworder and colorder instead.
Comments
0 comments
Please sign in to leave a comment.