Skip to main content

Dropdown list

Introduction

In order to limit users input options by creating a dropdown list, you can simply create a list of available options in the concept's JSON file in defaults directory. Simply add the following to your concept's JSON file:

"defaults" : {
"<property-name>" : [
{"Option 1" : "option_1"},
{"Option 2" : "option_2"},
{"Option 3" : "option_3"},
...
]
}

When user picks one of these options in the interface, their value will be passed to your Python code. It will also be recognized by other properties within that concept. This is important for the next tip, which is Hiding elements

Example

{
"options": {
"translation": [
{
"English to German": "en-de"
},
{
"German to En": "de-en"
},
{
"English to Chinese": "en-zh"
},
{
"Chinese to English": "zh-en"
},
{
"English to French": "en-fr"
},
...
]
}
}
OpenfabricAI Footer