DMXzone Server Connect Support Product Page

Answered

How to insert multiple records at once on repeating checkbox using Server Connect + App Connect?

Asked 18 Mar 2017 14:42:11
1
has this question
18 Mar 2017 14:42:11 Firdaus Rohman posted:
I have a dmx-repeat checkbox in a form and I want to use their values as records for a database table. A checked checkbox = 1 database insert. If user checked 3 checkboxes with id 1, 3, 6, then there will be 3 database insertion at once on form submit.

Replies

Replied 20 Mar 2017 08:40:54
20 Mar 2017 08:40:54 Teodor Kuduschiev replied:
Hi Firdaus,
Do you need to insert 3/6 same records?
Replied 20 Mar 2017 08:51:41
20 Mar 2017 08:51:41 Firdaus Rohman replied:
Hi Teodor,
Yes, for example, there are 10 tags, and when user ticks 3 of them, they will be 3 data inserts for the values of the checked tag inputs etc. On single form submit.

I've tried to follow Data Binding methodology but failed to emulate it (there's no Object>variable in the Globals>$_POST of the repeating input).
Replied 20 Mar 2017 08:53:40
20 Mar 2017 08:53:40 Teodor Kuduschiev replied:
So the tags should be inserted in the same database field, comma separated, or should they be separate records?
Replied 20 Mar 2017 08:56:19
20 Mar 2017 08:56:19 Firdaus Rohman replied:
The records are not the same. Each checkbox has a unique value. I want to insert the value respectively. 1 value = 1 database row.
Replied 20 Mar 2017 08:58:33
20 Mar 2017 08:58:33 Firdaus Rohman replied:
I have a dedicated database table for tags in separate record.
Replied 21 Mar 2017 07:43:58
21 Mar 2017 07:43:58 Teodor Kuduschiev replied:
If possible, please send a link to this page, where we can check it.
Replied 21 Mar 2017 08:30:25
21 Mar 2017 08:30:25 Firdaus Rohman replied:
I'm unable to upload the page at this stage. What I want to achieve is something like this tutorial, the only differences are;

I want to do insert instead of update
checkbox instead of text input
using App Connect instead of Data Binding

What are the steps I should do with App Connect + Server Connect? I don't have problem with repeating checkbox step as I already have it set. The only step boggling me is how to insert their values into database at once, just like you did it on that tutorial.
Replied 24 Mar 2017 10:04:09
24 Mar 2017 10:04:09 Firdaus Rohman replied:
Hello there,

I still need response on this. Let me know whether to insert values of repeating checkboxes into separate database row is possible with your extension.

I want to know the steps so no website to show yet.
Replied 24 Mar 2017 13:18:51
24 Mar 2017 13:18:51 Teodor Kuduschiev replied:
Hi Firdaus,
Here is how you can do this.
Add names to your checkboxes, containing [] at the end, for example: name="checkbox[]"
Then import your form in your action file.
Create a repeater step, use the checkbox group, imported under post as an expression.
Add insert step in the repeat step - and use {{$value}} as a value.
Replied 24 Mar 2017 16:29:27
24 Mar 2017 16:29:27 Firdaus Rohman replied:
Thank you Teodor that's definitely helpful. I previously did the same steps, but instead of typing {{$value}} manually, I selected $value from the repeater which produces incorrect code missing ].

Reply to this topic