SELECT Field: Set value, label in options, not via script

Hi all,

is it possible to set the options of a select field to have value, and label via the “options” of the DocType definition?

I know that I may set a list of dicts with label and value values via a client script. I would, however, like to set these options in the DocType definition directly.

If I copy the list/dict string into the options field, it does not work.

Thanks
DoCa

In Options you should not pass list. You should write each option in new line.

Like

Option in List:

 ["Option_1","Option_2","Option_3"]

In Option Field:

Option_1
Option_2
Option_3

Hi Abdeali,

Thank you for your suggestion. I already know how to fill the select options in the doctype definition with values.

What I am trying to achieve is to set the select options with a list of dicts in the form of:

[{“label”: “Label 1”, “value”, “1”}, {“label”: “Label 2”, “value”, “2”}, …]

directly in the doctype definition. Currently I am doing this via a client script on load of the doctype…

Best regards,
DoCa

You can create a doctype called YOUR DOCTYPE NAME

  1. Name
  2. Dictionary (Code)

Now in your doctype use a link field and use fetch from

now you can use long dictionary as well