Function lookup - set default values optionfield

Hello all,

Is there a way to set the default values of an OptionField by calling a function?

I have a list of options, but not all options must be selected at first, only a few. These options are dynamic, so I want to create a list of options that fill the OptionField. That works fine, but to set the defaults I want to use another function. That function is depended on another parametrization input, so I think I should be using a Function Lookup? So it would like:

options = [A, B, C, D]

selected_options = [A, C]

Both lists are dynamically changing depending on parameter input.

I hope my question is clear, thanks for the help!

Hi Ruben,

Thanks for the question. If I understand your question correctly, you would like to have dynamic defaults for the option field.

At the moment, the only way of achieving dynamically set input is by means of using a SetParamsButton. Logic can be defined to select the default options for the field based on certain criteria. But then the user first needs to click on the button for the fields to be set.

The dynamic option list, on the other hand, is easily solvable by using a callback function. An example of this can be found here.

Does this solve your problem?