- 1. What is the Dynamic choice widget ?
- 2. Setting up the task in the editing studio
- 3. Setting the dynamic choice attribute
- 4. Combine Dynamic choices with other Dynamic choices
- 4.1. Case study
1. What is the Dynamic choice widget ?
The dynamic choice widget allows your operators to select one or more values from a list, allows you to define a label for these values, apply and configure display conditions directly on the choices according to the value of another dynamic choice widget.
This widget is similar to the multiple choice one, but with additional possibilities.
The dynamic choice widget is located in your editing studio, in the Tasks category.
The concept of dynamic choice includes the widget and a new type of attribute.
2. Setting up the task in the editing studio
This task allows you to configure several choices. For each choice, you can select:
- A value : This data is mandatory and must be unique among all the other values in the brick.
- A label: This data is optional. If it is filled in, it will be displayed in the application for operators instead of the value. If a choice does not contain a label, the value will be displayed in the intervention form.
2.1. Allow multiple selection
By ticking the “Allow multiple selection” option, the operator will be able to choose several answers. By default, when this option is not activated, the operator can only select one answer from the choices.
2.2. Choice selected by default on the application
Define a choice selected by default. If multiple selection is enabled, several default choices can be defined.
2.3. Configure choices
You can add, modify (both the value and the label) or delete a choice.
You can also reorder choices by using the three dots to the right of each choice.
As with the multiple choice principle, it is possible to define default choices when setting up the task.
2.4. Link to an attribute
As for other tasks, you can link this task to an existing attribute. The attribute must be of the dynamic choice type.
For example, you can retrieve the value of an existing attribute from your databases, using the “Pre-fill value in-app” option.
You can also update an existing attribute by retrieving the data entered by your operator using the “Allow editing a prefilled value” option.
3. Setting the dynamic choice attribute
Like any other attribute, dynamic choice is available for documents, assets, jobs and users.
In this example, we are going to work on setting up an attribute for asset.
From the “Attributes” tab of your database, click on “Create new attribute”.
In exactly the same way as in the editing studio, you can:
- Add new choices
- Delete existing choices
- Modify the value and wording of choices
- Reorder choices
- Allow multiple selection of choices
- Define default choices
Once this stage is complete, link this attribute to the ‘multiple choice’ brick created earlier in the form.
- Any changes made to a choice that is already a value for certain assets will be reflected on the asset in question. For example, deleting a choice from an attribute will result in the value being removed from all the assets that currently have it.
- When a dynamic choice task is linked to an attribute, editing the attribute in the database has a direct impact on the configuration of the form, which is updated even if the version has already been published.
- It’s not possible to convert a multiple choice to a dynamic choice (or vice versa).
- For the time moment :
- It’s not possible to import or export dynamic choice attributes. However, it is possible to import and export assets with a dynamic choice attribute.
- Multilingual support is not available
- On the application, it’s not possible to filter in the various lists (document, asset, job) by an attribute of the dynamic choice type
- It is not possible to use a studio tag as the value/text of a choice or as a “default value”.
- The history of asset values is not available
4. Combine Dynamic choices with other Dynamic choices
This option allows you to select dynamic choices and associate them with other dynamic choices. This setting allows you to condition the display of these latter choices (quite similar to the “display condition” principle for tasks, available in the editing studio).
This solution enables dynamic choice attributes to be associated with each other, regardless of the type of data to which they are linked:
- Assets
- Documents
- Jobs
- Users
For example: the choice of an asset attribute will be displayed according to the value of a document attribute.
The association can be configured both directly at attribute level and in the editing studio.
4.1. Case study
4.1.1. Configuring the association at the attribute level
In our form, we want to display only the country choices according to the continent previously selected (country belonging to the continent in question).
- Go to the database tab and create a database with the name “City”.
- Create 5 assets with the following names:
- Berlin
- Casablanca
- New York
- Paris
- Kuala lumpur
- In the ‘Attributes’ tab of this database, create a dynamic choice type attribute called ‘Continent’.
- Add 5 values for each choice:
- America
- Africa
- Asia
- Antarctica
- Europe
- Click Save. For this attribute, we will not add labels or default choices.
- Create a second dynamic choice attribute called “Country”
- Add 4 values for each of the choices:
- France
- Allemagne
- Maroc
- Malaisie
- To configure the association so that the choice “France” is displayed if the Dynamic Choice “Continent” is set to “Europe”, select the value “France” then click on the “Associate” button.
To Note It is also possible to select several choices at the same time to define the same association for them.
- Once this has been done, a list of all the dynamic choice attributes existing in your space will be displayed. Select the ‘Continent’ attribute.
To Note It is also possible to select several attributes from this list. In this case, an “or” condition will be applied between the 2 attributes selected (e.g. the choice “France” will be displayed if the Dynamic Choice “Continent” has the value “Europe” OR if the attribute ‘X’ has the value ‘X’).
10. Select the “Europe” value, then click on “Validate”.
- In the same way, continue configuring the associations for the 3 remaining countries as shown in the video below.
4.1.2. Setting up the form
- Create a form and then add two dynamic choice tasks, linking each tasks to its corresponding attribute.
- The Continent task ⇒ dynamic choice attribute “Continent”.
- The Country task ⇒ dynamic choice attribute “Country”.
- Start the job via the preview
- Once the continent of your choice has been selected, the corresponding countries will automatically be displayed in the dynamic choice box that follows.
- If you deselect the “Europe” choice to select another, the “France” country will automatically be deselected. So please check and reselect the choices when you make similar changes.
Notes
- The order of the dynamic choice tasks is important during configuration. The association logic only works from top to bottom (irreversible direction). For example: if you put the “Country” task before the ‘Continent’ task, the association will not be valid.
- Also, if the other Dynamic Choice attributes that affect the display of my choice are not present in my form (no task linked to the attributes), the association will not be valid.
⇒ When an association on a choice is invalid, the choice will be displayed as if no association had been defined.