Is it possible to change a Data Blaze form field caption to the name of field instead of "Data Blaze Select" prior to selecting an option . I want to have multiple Data Blaze form fields in a form, but all the fields will look exactly the same all labeled "Data Blaze Select" prior to selecting an option. I would like to make entry as obvious as possible for the end user. I know I can add text outside the field as a label, however space is valuable in this situation. Thank you
{note}Brand:{dbselect: SELECT Brand AS selected_brand FROM Brand ORDER BY Brand ASC LIMIT 1000; space=1UqkR9IZ3x2DiN5MBCjByd; menu=yes}{if: selected_brand ="-Add New"}{formtext: name=input_brand}{brand=input_brand}{dbinsert: INSERT INTO Brand; space=1UqkR9IZ3x2DiN5MBCjByd; autoaddfields=yes}{else}{brand=selected_brand}{endif}{endnote}{=brand}
![image](https://community.blaze.today/uploads/default/original/2X/e/ec96eefa3584ce152ea63d3a6257e5784f9e9f8a.png)
Hi @Aaron_Pletcher ,
You can use name field to label the field
Something like this.
{note}Brand:{dbselect: SELECT Brand AS selected_brand FROM Brand ORDER BY Brand ASC LIMIT 1000; space=1UqkR9IZ3x2DiN5MBCjByd; menu=yes; name=brand}{if: brand.selected_brand ="-Add New"}{formtext: name=input_brand}{finalbrand=input_brand}{dbinsert: INSERT INTO Brand; space=1UqkR9IZ3x2DiN5MBCjByd; autoaddfields=yes}{else}{finalbrand=brand.selected_brand}{endif}{endnote}{=finalbrand}
I guess the most obvious option wasn't obvious enough for me, thank you!
When I change this to a multi-select field, the output is an error. Can you suggest a way to output the selections only separated by spaces?
{note}{dbselect: SELECT Brand AS selected_brand FROM Brand ORDER BY Brand ASC LIMIT 1000; space=1UqkR9IZ3x2DiN5MBCjByd; menu=yes; name=brand; multiple=yes}{if: brand.selected_brand ="-Add New"}{formtext: name=input_brand}{finalbrand=input_brand}{dbinsert: INSERT INTO Brand; space=1UqkR9IZ3x2DiN5MBCjByd; autoaddfields=yes}{else}{finalbrand=brand.selected_brand}{endif}{endnote}{=finalbrand}
![image](https://community.blaze.today/uploads/default/original/2X/b/b32daf7ed2d325c288e3219d37059bebbb684cbb.png)
Hi @Aaron_Pletcher ,
Sorry for the late response.
When you change the DbSelect's multiple from no to yes, the form name becomes list. So the logic changes here.
{note}{dbselect: SELECT selected_brand FROM Brand; space=1UqkR9IZ3x2DiN5MBCjByd; menu=yes; name=brand; multiple=yes}{if: count(filter(brand, x -> x.selected_brand == "-Add New")) > 0}{formtext: name=input_brand}{dbinsert: INSERT INTO Brand SET selected_brand=@input_brand; space=1UqkR9IZ3x2DiN5MBCjByd}{else}{input_brand=""}{endif}{endnote}{finalbrand=join(map(brand, x -> x.selected_brand if x.selected_brand <> "-Add New" else input_brand), " ") }{=finalbrand}
To show input brand, I used filter and count from list functions to show the field or reset input_brand.
Also I used join and map to, to concat list into string. As you have a custom field, I added if logic to replace "Add New" to the input_brand.
I also change Insert row query, to make input_brand as an alias.
Please let me know if this helps!