Select all options by default in MultiSelectField

I’m currently writing a code where a user can define a series of points in a table. As of right now the points in this table are plotted in a view and a line is drawn between them. Now I have been asked to add a dropdown menu below this table where a selection can be made of which points the line needs to be drawn between (the other points will still be plotted as markers).

Now I have created a MultiSelectField with all the entries from the table but in general the line will most often be drawn through all/most points. Therefore, to make the user life easy I would ideally have all the options be selected by default.

I currently have the following code in my parametrization where the options for the MultiSelectField are retrieved by checking the table. I have so far not been succesful in providing the default keyword with the same values as the options. Can someone help me with this?

Hi Rutger,

Unfortunately, as far as I am aware, dynamic defaults are not currently supported. However, in the specific case of selecting all of the options, a “select all” option should appear to the user by default. The user can click this and then only needs to uncheck the undesired options. I couldn’t find it in the changelog easily, so am unsure when this was added. It is possible you may need to migrate for this to appear.

Other than a “select all options”, if you want to dynamically set the values of a MultiSelectField, you may need a button instead as shown here. Or, in case the options of your field are defined based on a file-upload, and do not change afterwards anymore, you could set the field with all options selected in the ParamsFromFile

hello! just to resurface this as this would be really helpful for us too

1 Like