During testing of one of our flows it was noticed that the select field didn't have the correct option prefilled.
After investigating I found that passing a prefilled value to a dropdown (select) type field will cause all options in the list to have the selected attribute in the HTML due to the mustache logic in your select.html template.
Using objects as the values of an enum array:
customer_fields: { select_field_example: { enum: [ {value: 'Option 1', prefilled: true}, {value: 'Option 2'} ] } } }
works to select only one of the options but then it will render as [object Object] when using the dropdown as the binding in the mustache template refers to it by the {.} syntax, referencing the whole object.
During testing of one of our flows it was noticed that the select field didn't have the correct option prefilled. After investigating I found that passing a prefilled value to a dropdown (select) type field will cause all options in the list to have the selected attribute in the HTML due to the mustache logic in your select.html template.
Using objects as the values of an enum array:
customer_fields: { select_field_example: { enum: [ {value: 'Option 1', prefilled: true}, {value: 'Option 2'} ] } } }
works to select only one of the options but then it will render as [object Object] when using the dropdown as the binding in the mustache template refers to it by the {.} syntax, referencing the whole object.