Dropdown

Modified on Fri, 9 Oct at 11:49 AM

Use this measure to request one or more answers from the reporter based on a list of options. When the dropdown is added to the canvas, a prompt asks which list to show items from to the Reporter. Choose a pre-made list or create a new list.


Dropdown measure input


Introduction to dropdown.


  • Click 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.

“Go to list” button


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

Allow reporter to select multiple items



  • Default selected element - The list element is selected by default. The list element must have a PrettyID. A greyed-out list element cannot be used because it has no PrettyID. Read more about how to edit list items.


Default selected element

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 that contain 2019: indexOf('2019', item.text) > -1
  • Variables available:
    • global.OrgUnitPrettyId (PrettyID of the org.unit)
    • global.OrgUnitTagPrettyIds (tag PrettyIDs of the org.unit) 
    • item.text (list element name)
    • item.prettyId (list element PrettyID)
    • item.context (list element context object)
    • measure points (e.g. measure_ab12)

Filter expression in the advanced settings

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


Examples of filter expressions

// 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

Use the and syntax to exclude several items from a larger list of items.

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