This topic contains 17 replies, has 0 voices, and was last updated by Anonymous 11 years ago.
- September 22, 2009 at 1:51 am #314
Hello, is it possible to populate a drop down from a table i.e say column 1 is a column of names I want to populate a drop down with these names. Have tried with set field but no luck. ThanksSeptember 22, 2009 at 10:08 am #4784
Afraid not if you are referring to the same form instance, but it can be done with ‘connections’ to /from an external database (or form connection) where you write the table contents out to your DB/form and then read them back into a drop down object using the ‘connect’ actions.September 22, 2009 at 12:27 pm #4785
Thanks for the reply.September 22, 2009 at 1:05 pm #4786
Follow up question, are you saying I can create a form-Database-Table and make a connection to my main form and have it fill the drop down, if so will this effect any of the behaviors or notifications of the form.September 22, 2009 at 4:32 pm #4787
sort of, although you can use a form OR a database table. using the database functions will require the Connection Agent module though (contact email@example.com for details on that) but with a form you can use a form connection.
have a look at the userguide on integration to see what is involved with this.
it won’t effect any other behaviours or notifications. the key will be how to write the data out from your table on this main form into the other form (or database table) and then how to then read that data into your drop down. if the drop down is on another page of your form then you could do the ‘write’ on the ‘show next page’ action and then the ‘read’ on the ‘when page is opened’ on the page that has the drop down ?September 23, 2009 at 2:11 am #4788
ijobling, thanks for your responses. Here is what I am tiring to do. I have a main form with 11 pages (call it mainform), page 11 is a set up page, it has a drop down box amongst other things which when a persons name is selected populates various input boxes in the other 10 pages. I have a second form called DBform, it has a table with sales people’s names, gender ect…
I want to populate the drop down box on the set up page of mainform with the names from the table on my DBform. I have read about connections and played with making one but am a little lost on how to proceed.
Do I create a Insert or update connection, am I inserting in to drop down box or updating a drop down box, do I start from the mainform or DBform. Sorry to ask such basic questions but I am not getting how to proceed. Your advice is appreciated.September 23, 2009 at 8:14 am #4789
If I were you I would put the ‘mainform’ to one side and create yourself a simple test form to work with so you can prove the concept and see what it does..
set up your form connection ACTION to READ from your DBform where you set up the RETURN parameters to the column in your table that stores the names. You don’t specifically need any ‘send parameters’. you will then be shown TEST.. try it to see what it returns (ie it should return the content of that table from your form instance on the DBForm table)
then on your ‘test’ form, add in a drop down and a button. under the button set up your ‘connect’ action to this form action and then preview the form, hit the button and you should see the drop down populating.
in terms of populating a drop down from a connection, note that in the Return Parameters section of the Connect script , check the Items option corresponding to the field you want to populate you list or drop-down object withSeptember 23, 2009 at 12:18 pm #4790
Thank you for your response I will work on your suggestions.September 23, 2009 at 12:59 pm #4791
ijobling, got it Thanks again.September 24, 2009 at 12:05 am #4793
ijobling, I got the connection working and now have 5 drop down boxes. I need to say choses the 4th caption from dd box 1 and have the 4th captions from dd box 2 through 5 be chosen. Is it possible to create a behavior like this I have tried using various methods but have not been able to find a way. ThanksSeptember 24, 2009 at 8:06 am #4794
if you mean you want to select from drop down 1 for that to automatically cause the other drop downs to be ‘selected’, then use the SetField script to set these other fields to the state – checked
but over all of this, if your need is to have one drop down where the users are making a decision and these other fields are all stored in your external form, why not just have the one drop down populated from the ‘connection’ action and then when the users select from the first do another ‘connection’ to your external form to write the other information back into other (perhaps text) fields on the formSeptember 24, 2009 at 12:42 pm #4795
ijobling, thanks again for your response they are all very helpful. I will think on your suggestion.September 25, 2009 at 2:28 am #4796
ijobling, another question. Every thing works in preview mode i.e I have 5 drop down boxes have a connection, my drop down boxes populate. Under dd box1 I have a behavior on a data change event. So that when I select from drop down 1 this automatically cause the other drop downs to be ‘selected’. This all works in preview mode or edit form mode. But when I open my form in view mode the dd boxes populate via the connection but the behaviors do not work. The first choice is selected and can not be changed. Is there a way to correct this, would your suggestion above correct this. ThanksSeptember 25, 2009 at 8:01 am #4797
look when you are previewing what ‘stage’ and ‘role’ the form is running in. when you deploy the form and load it, it will be in the first ‘stage’ of your form and the ALL role. If these are different then review your field states. if the objects you are trying to write into are ‘disabled’ for instance you will not be able to write into them. but also it could be if you have written your behaviours under a condition that isn’t being satisfied in this stage/role.
look also at the ‘debug’ function where you can select the stage and role for the form and then preview in ‘debug’ mode where you will then see all the form actions listed out in the debug painSeptember 26, 2009 at 11:54 pm #4798
ijobling, once again thank you for your response all is working fine. I did not have the stage set. Everything is pleasingly generalized in that there is no personal info hard coded in to my child form, it all comes from my parent form. I have one more step and that is to create a parent child relationship between my Parent form(DBform) and my child form(testform).
I created an input field(to store InstanceID) call it DB-InstID and a button on DBform.
Under the button behavior I have:
Start-setfield DB-InstID to empty-Submitdata-ShowForm-Exit.
Showform: I am choosing Single Child and DB-InstID to hold the InstanceID.
The child has a behavior on form open, were I have my connection set.
In my DBform I populate my table, then click my button. The testform opens, the drop down boxes fill, but the drop down boxes have additional choices from previous instances. Is there any way to have the drop down boxes have only the input from the most recent Instance?
You must be logged in to reply to this topic.