Dropdown

Modified on Tue, 25 Mar at 2:10 PM

Use this measure to request one or more answers from the reporter based on a list of options. When you add the dropdown to the canvas, you will be asked to configure which list to show items to the Reporter. You can choose between pre-made lists or create a new list.



Introduction to dropdown.


  • Press the "Go to list" button to add or change items in a list. This view can also be accessed under advanced settings. See more information about Lists.


  • Allow reporter to select multiple items - The reporter can choose several options from the list.



  • Default selected elementThe list element is selected by default. The list element is required to have a prettyID. If the list element is greyed out it cannot be used as it requires a prettyID. Read here for how to edit list items.



Filter expression


Lists can be reused in several measure points where the list items may be relevant for other purposes. If not all list values are relevant, some values can be excluded from one dropdown measure and included in another. A filter expression must be applied in the advanced settings.


  • Filter list element names to contain 2019: indexOf('2019', item.text) > -1
  • Variables available:
    • global.OrgUnitPrettyId (pretty id of organization unit)
    • item.text (list element name)
    • item.prettyId (list element pretty id)
    • item.context (list element context object)
    • measurepoints (eg. measure_ab12)

Mathematical expressions are available the same way they are in Calculation.


Examples of expressions for Filter Expression

// Filter item based on matching context with structured data value "wasteType"
item.data.wasteType == other_dropdown.data.wasteType

// Only show items which contains part of another
// dropdowns prettyId (eg. NACE_A in NACE_A_1)
indexOf(item.prettyId, other_dropdown.prettyId) != -1

// Only show items where a value is smaller or
// equal to a calculation (which defaulted to 100)
item.data.someKey <= getValue(measure_calculation, 100)


Exclude several items from a larger list of items

To exclude several items from a larger list of items using 'and' syntax.

indexOf('list_item_1', item.prettyId) == -1
and
indexOf('list_item_2', item.prettyId) == -1
and
indexOf('list_item_3', item.prettyId) == -1


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article