-
My form has a field which stores the values -1, 0 and 1 to reflect three states. It would be nice to have a drop down list showing the labels of those states to help the user to decide. I guess this must be somewhere in the 'select' as type documentation, but I can't find it ;) All I could find is creating an option list from querying another table, but this might be overkill in this case … |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hello! Isn't this example from the documentation what you need? select
'form' as component,
'examples/show_variables.sql' as action;
select
'Fruit' as name,
'select' as type,
TRUE as searchable,
1 as value,
'[{"label": "Orange", "value": 0}, {"label": "Apple", "value": 1}, {"label": "Banana", "value": 3}]' as options; |
Beta Was this translation helpful? Give feedback.
-
Very cool. Nothing about the topic, but is it possible to build that JSON dynamically? |
Beta Was this translation helpful? Give feedback.
-
Just for curiosity to know if the SQLPage would understand such thing, an SQL statement instead of a string as like in the example. |
Beta Was this translation helpful? Give feedback.
-
Thanks for enlightenment. that discussion you linked solve my question. |
Beta Was this translation helpful? Give feedback.
Hello! Isn't this example from the documentation what you need?
https://sql.datapage.app/component.sql?component=form