Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Help! How to pull data from a database into form

Avatar

Level 1

I have information store in a database and I need to import(place) it onto a form.  The form already has a connection to the database, I just don't know how to update the information on the form with the information that is stored in the database.  Can anyone help?

13 Replies

Avatar

Former Community Member

In the DataConnection screen where you define the connection, a tree view of the columns in your DB are displayed. You need to bind these columns to the fields on your form. You can drag and dropthe column to th ecorresponding field (then a bind expression is set up). A binding icon will appear beside the column to indicate that it has been bound.

Paul

Avatar

Level 1

I have that step done.  I am able to pull info from the database, but the problem is that it is pulling the first entry in the database.  I would like to have a way to enter in a 12 digit number and press a button to populate the form with the info that is stored in the database.  My goal is to pull different users information(right now the form pulls the first entry).  I don't exactly know how to set this up.

Avatar

Former Community Member

OK so you want to pull a specific record ...this will require coding to do it. One of my colleages has written a blog on this topic. I suggest you start there.

http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/

Paul

Avatar

Level 1

Thank you for your help so far.  I looked through the site you posted and I guess I just seem really lost.  I understand Java but when it comes to Javascript, I just lose my mind.  I tried doing some of the things in the site and it just didn't make sense.

Avatar

Former Community Member

I also did a webinar for the Acrobat Users Group and it was recorded ...you can see the webinar here:

http://adobechats.adobe.acrobat.com/p69655795/

...it might help explain a few things.

Paul

Avatar

Level 1

I wasn't able to go to the webinar, but I was wondering if you could give me a different direction also.  I created a drop down box or list that is connected to the database.  The list is still just syncing the first entry in the database and not the whole database it self.  Do you have an any idea why this may be doing this?

Avatar

Former Community Member

Did you turn on the Dynamic Properties of the DDList and bind to the "Specify Item Values"?

Paul

Avatar

Level 1

I did turn on the Dynamic Properties and the items are bind, but I don't think they are bind to the "Specify item Values". How would I go about doing this?

Avatar

Former Community Member

The Specify Item Values will become a link if dynamic properties or turned on. Click on teh link and a wizard will popup allowing you to choose a Dataconnection and the column that you want to populate the DDlist with.

Paul

Avatar

Level 1

Ok, I now have the drop-down box created and it is liked to the database. The problem that I am encountering now is that when I select the second entry in the box, the rest of the fields for that number don't update. Is there something else that I must do? Thanks for all of your help thus far, it has been greatly appreciate.

Jonathan

Avatar

Former Community Member

Yes there is ....now you need to do a query agianst the DB looking for that specific record. I did a webinar on this topic some time ago but i believe the link is still active. Have a go at this:

http://adobechats.adobe.acrobat.com/p69655795/

Paul

Avatar

Level 1

I have not been able to view either one of the webinars that you have sent me.  Neither one of them showed up at all.  Do you have the webinar saved in a different location that I could view?  I am having a difficult time with writing a correct query or javascript to pull in the rest of the data in.

Avatar

Former Community Member

I do not have another source for that ....the information and technique can also be found on this blog entry:

http://forms.stefcameron.com/2006/09/29/selecting-specific-database-re cords/

Paul