Count of a multiselect box

  • Goal:

  • Steps:

  • Details:

  • Screenshots:

  • App json export:
    I am trying to display the number of selections from a multiselect box but I don't understand how to do this in retool. Do I need to write a script and if so not sure how to form it.

Hello Chidi!

The thing you are looking for would look something like {{yourMultiselectComponentName.value.length}}.

If you select your component and view its state you should see something like this:

Here I can see that the value property is an array, so I chose to get the length of that array to get the number of selections.

Components have lots of interesting properties that you can explore in the State window which can help influence your solutions and design patterns. To get there easily, you can right click the component and select View State: