Getting values from a multiple select form control and saving as a list

I have an update form with a multiple select form control. How can I save the values selected into my table field as a list that is separated by a comma (example: selection1, selection2, selection3)?

Thanks for your help!
Cynthia

Hi.
You can try to split the column/field where you have comma-separate-values. And pass that as the source for the select form control.
To bind the TEXT & VALUES part, you will have to use $value. You won’t be able to use any other fields in the table.

Thanks for the suggestion, Sid.

I actually figured it out. Here’s a detailed step-by-step of what I did for those who need more detailed instructions like me who is still fairly new with Wappler.

  1. Set-up an insert (or update) server action with the column value set to {{$_POST.column_name.join(",", null)}}
  2. Under the POST globals, select the column name and under the field properties check the “multiple” checkbox
  3. In my webpage I created a form with a custom select input and checked the “multiple” checkbox for the input field and added brackets to the name of the input (i.e. column_name)

That’s it. I hope that can help someone else.

2 Likes

I think I misread your question. Reading your solution, I see what you were asking originally.
What you have done is actually the standard way of capturing multiple values from a form and save to DB as comma separated values in Wappler.
Glad that you could figure it out.