Fill Drop down from Table

Home Forum Behaviors Fill Drop down from Table

Tagged: , ,

This topic contains 17 replies, has 0 voices, and was last updated by  Anonymous 9 years, 1 month ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #314

    Anonymous

    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. Thanks

    #4784

    ijobling
    Participant

    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.

    #4785

    Anonymous

    Thanks for the reply.

    #4786

    Anonymous

    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.

    #4787

    ijobling
    Participant

    sort of, although you can use a form OR a database table. using the database functions will require the Connection Agent module though (contact sales@perfectforms.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.

    http://www.perfectforms.com/Documentation/manual/html/d_connectionsintegration.htm

    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 ?

    #4788

    Anonymous

    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.

    #4789

    ijobling
    Participant

    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 with

    #4790

    Anonymous

    Thank you for your response I will work on your suggestions.

    #4791

    Anonymous

    ijobling, got it Thanks again.

    #4793

    Anonymous

    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. Thanks

    #4794

    ijobling
    Participant

    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 form

    #4795

    Anonymous

    ijobling, thanks again for your response they are all very helpful. I will think on your suggestion.

    #4796

    Anonymous

    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. Thanks

    #4797

    ijobling
    Participant

    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 pain

    #4798

    Anonymous

    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?

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.