Building Multiple Choice Dynamic Checkboxes

I’m trying to build dynamic checkboxes with multiple choices that will insert each checked box in the database.

The code will display all the checkboxes from the database perfectly.

Also, it will insert one choice into the database perfectly.

The problem is getting it to insert more than one choice to the database.

Any help is appreciated?

Below is the sample code:

Hello @revjrblack
How do you wish to insert the checkboxes values in the database?
One record holds the values in one field like: 1,2,3,4 OR new record for each checkbox?

First, let me say, “Thanks for your help!”

Insert into one record.

Each candidate the fills in the questionnaire will be id’ed and their response will be queried by that id and date (if necessary).

However, I’m opened to any other scenarios that might make it easier.

Your checkboxes must have the same name which ends with []
Example: name=“aim2go_career[]”

Import them under server connect and in the insert record step select the checkbox under the post variable and add the join filter:

{{$_POST.aim2go_career.join(",", "")}}

This will insert multiple values in one field.

1 Like

Thank you very much. I will give it a go. I appreciate your time to help resolve this.

I’ve tried your recommendation and I must be doing something wrong. I have included the images (screen shots) of each of the areas that now have the changes as recommended.

The sample code …

The post list …

The code field name …

The insert …

The database structure …

After an insert attempt, these fields are showing as blank …

What have I overlooked?

Thanks in advance for your assistance.

I think I mistyped the .join(",", “”)}}

However, after I corrected it, these fields are still blank.

I just recreated this locally - and it inserts the data as it should.
Can you please double chekcyou saved your server action, after inserting the proper: join code? Your quotes in the join code do not look fine to me. It must be:
.join(",", "") - please copy it from here.

Thanks!

I got it to work, but only after looking at the json file in the DMXConnet/api folder. I found the field types were set to ‘number’ – I guess due to the input being assign to checkbox?? However, after I manually changed all of the to text, and then deleted the server-side file, then uploading the changes, it worked just as you said it should.

I appreciate your patience with our efforts.

1 Like