@PICK_MANY_QUESTION
Specifies that a variable will be multiple values out of a list of choices.
Before generating a document, DocuMold will display checkboxes to choose the values.
The variable will be a List
containing the chosen values.
Usage
Parameters
variable |
(Required) The variable this applies to. Do not use double quotes ( |
choices: |
(Named, Required) The choices to display. Can be a list of values, a list of list of two values (list of pairs), or a DT_CHOICES. See “More information” below |
example_value: |
(Named) The initial value in the form when preparing a template (via “Prepare a template”). If not given, the value of |
help_text: |
(Named) Displays a clickable (?) bubble beside the label. Clicking it will reveal this text. Useful to give directions to the user of the DocuMold template. |
initial_value: |
(Named) The initial value in the form when using a template (via “Use a template”). This is also the default value of the |
label: |
(Named) The text to display beside the checkboxes that asks for the value. Defaults to variable’s name. |
optional: |
(Named) Set this to |
Parameters with “Named” mean that you must specify the name of the parameter and a colon before its value.
Ex: choices: "its value"
Examples
More information
This action does nothing to the document itself; it gets erased when generating a document.
When generating the document, the specified variable will be a list of the selected values. You can use
the CONTAIN
function to test if a value was selected.
The choices can be:
- A list of values: each value will be displayed as a choice and the value will be in the variable when selected.
- A list of list of 2 values: Basically a list of pairs. For each pair, the first value is the text to display
besides the checkbox and the second value is the one that will be in the variable when this is selected.
So
[["By name", "name"], ["By age", "age"]]
means the choices areBy name
andBy age
, and the variable will be set to either"name"
or"age"
. This is useful to provide a clearer choice to the user, without having to write the longer text everywhere. Values can be non-text, such as numbers, dates, etc. DT_CHOICES
is a function that allows getting choices from a data table. SeeDT_CHOICES
for more details.
All @..._QUESTION
actions are normally placed at the end of the template to avoid overwhelming unfamiliar users.
The @IF
action has no effect on the @...QUESTION
actions. The @...QUESTION
actions have an effect even when they is hidden.