How to fill a Confiform form from an external database, and then update the database via the form

steven rothenberg February 14, 2020

I've gotten as far as being able to pull information from a MySQL table into a field of type Database-Dropdown on my Confiform form.  Assuming that this success indicates that all configuration steps for the database connection are working properly, I now want to be able to modify information brought into the form and have the changes communicated to the database.

I viewed the CRUD site: (and one or two others that directed me to the site below)

https://wiki.vertuna.com/display/TEST/CRUD+-+Simple+demo+to+show+how+to+setup+ConfiForms+to+save+data+to+database+table

Are there other resources anyone can point out, including ones that perhaps demonstrate how other field types like check boxes and radio buttons are handled?  Also, any other suggestions are welcomed.

Steve 

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 15, 2020

Probably this is the best page to cover this - https://wiki.vertuna.com/display/CONFIFORMS/Accessing+field+values+and+properties

It explains what is stored (internal value) for each field type and what properties each field type has

Checkboxes operate on true/false and Radio buttons (same as dropdowns and checkbox groups) operate on options with properties id and label

steven rothenberg February 15, 2020

Thanks for the tip, Alex!  Sounds like just what I need.

Steve 

steven rothenberg February 25, 2020

Having digested the contents of the sites you've suggested, I am up against one more obstacle.  As I mentioned in an earlier post, I am quite sure I am connected to the db containing the table I want to add a row to via my form.  I can populate a database dropdown field with values from the table I am trying to insert a record into.

I'm using an IFTTT macro action = Run Javascript , event = onCreated.  I copied the sample solution code snippet from one of the sites you suggested, ending up with this insert section:

    <ac:structured-macro ac:macro-id="e769fd3d-8d27-451c-ba1a-ccf4e4d32305" ac:name="confiform-ifttt" ac:schema-version="1">

      <ac:parameter ac:name="action">Copy ConfiForms Data to DB</ac:parameter>

      <ac:parameter ac:name="extras">7422036e-9a6f-4455-92d9-7140131fb9da</ac:parameter>

      <ac:parameter ac:name="event">onCreated</ac:parameter>

      <ac:parameter ac:name="title">INSERT INTO course_info.booklist(department, courseNumber, courseName, archiveDate, looseLeafISBN, textTitle, edition, publisher, reqOrOpt, notesToStudent, notesToBookstore, authors) VALUES('[entry.department1]', '[entry.courseNumber1]', '[entry.courseName1]', '[entry.archiveDate1]', '[entry.looseLeafISBN1]', '[entry.textTitle1]', '[entry.edition1]', '[entry.publisher1]', '[entry.reqOrOpt1]', '[entry.notesToStudent1]', '[entry.notesToBookstore1]', '[entry.authors1]' )</ac:parameter>

      <ac:parameter ac:name="extras2">id:[entry.id]</ac:parameter>

      <ac:rich-text-body>

        <p>

          <br/>

        </p>

      </ac:rich-text-body>

    </ac:structured-macro>

 

I don't get any errors when I Update the form, but nothing is written to the database.  Not much in the way of error messages, attempted writes, etc. in the MySQL side.  Any suggestions on what I'm missing, such as the reference to the database (prompted for when I create a Database Dropdown type field?  Or, some troubleshoot tips for getting this to work?  I can see the records being added to the Edit/View dropdown list at the bottom of the form, and this functionality appears to work fine

Thanks!

Steve

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 26, 2020

I am really unsure about this "IFTTT macro action = Run Javascript ". Where do you have this and how this is related to the IFTTT that attempts to copy the data into the database?

Really, without seeing your complete configuration it is hard to tell anything. Open support request with us and we can talk about this issue in more details

https://wiki.vertuna.com/display/VERTUNA/Support+Request+Form

steven rothenberg February 26, 2020

Thanks for the quick reply, Alex,. I'll do exactly that!

Steve 

Lilian August 4, 2021

Hi! Is there any update to this question of how to update an external database with confiform date? Thanks!

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 5, 2021

ConfiForms has a way to communicate with external databases and it can be set up to react on changes made to ConfiForms records - https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-CopyConfiFormsDatatoDB

(have this for 3+ years or so, what "update to the question" you are looking for?)

Like Lilian likes this
Lilian August 5, 2021

Thanks Alex for your response - you are quite reliable! I was referring to Steven's quest for assistance with his javascript...I think he opened a ticket and was wondering the outcome. I know it's over a year ago - I thought he might respond. I don't have a need for this solution now, but wanted to know for the future.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events