Forums

DB Save - update conditions

mduda 23 Jun, 2016
Hello Bob,

I would like to do two DB saves. The first is fine - simply saving the form to the table. The second DB save, I'd like to update several specific fields in my comprofiler table upon submit (ex. cb_student1teacher)

I've trolled through everything in the forum and am trying to piece it together to suit my situation. How far off the mark am I?

DB Read pulls from CB
I added a hidden field on the form called 'user_id'
I don't have the table connected on db save yet because I know the update conditions is not correct.

[attachment=0]b2s_cf_onload.png[/attachment]

[attachment=1]b2s_cf_onsbmit.png[/attachment]

[attachment=2]b2s_cf_updateconditions.png[/attachment]
GreyHead 23 Jun, 2016
Hi mduda,

What exactly is the question you are asking?

You have a Custom Code action that says 'refresh then redirect' - if it does redirect then everything after that will be ignored.

As you said, the Update Conditions won't work, only the first return will be used.

You can always get the current User ID after the form submit sif you need it.

Bob
mduda 24 Jun, 2016
Thanks Bob - I understand what you're saying about moving the refresh code to the end of the on submit - makes sense...although interestingly everything after was still working.

After re-evaluating, I decided to just update the all of the fields that were included in this form in the comprofiler table. So, I adjusted the code in the update conditions to equate the user id of the form with that of the comprofiler table. All seems to be working.

Thank you.
mduda 25 Jun, 2016
Bob - I'm at a loss on this.

I have two DB Save actions and d GSheet save action. When I enable the first DB Save (community builder table) and GSheet, both were great.

When I enable the second DB Save, I get a 1062 error on the CB table. Each of the DB saves works independently, but when both are enabled, I get an error.

I have an unset code before the second dbsave, but still the error.
[attachment=0]onload.png[/attachment]
[attachment=2]dbread.png[/attachment]
[attachment=1]onsubmit.png[/attachment]
mduda 25 Jun, 2016
[attachment=0]onload.png[/attachment]
[attachment=2]dbread.png[/attachment]
[attachment=1]onsubmit.png[/attachment]
mduda 25 Jun, 2016
This is the setup
mduda 25 Jun, 2016
sorry Bob - but I'm trying to upload images, and they are not uploading.
This topic is locked and no more replies can be posted.