A client asked us about the following topic, and we don’t have a clear answer:
How can I add a button or a selector (button/select) to a Coding or API Call card?
I noticed there are examples available in the information icon, but when I tried using them, they didn’t work as expected. Is there a functional example or detailed guidance on how to implement this properly?
I tested it in the Code Executor, and it returns the text from the select element, but when I move it to a normal environment (preview), only "Choose Option" appears, and the other elements don’t show up.
Here’s the test I performed:
function handle(variables, globalVariables) {
return {
variables: {},
html: "<p>Choose option</p>",
elements: [
{
"text": "Option #1",
"value": "1"
},
{
"text": "Option #2",
"value": "2"
}
]
};
}
Can you guide me on how to make this work correctly?