Auto populate - only adds data from first row in database - InfoPath Dev
in

InfoPath Dev

Auto populate - only adds data from first row in database

Last post 07-16-2012 06:28 AM by StuartBall. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 07-12-2008 04:45 AM

    Auto populate - only adds data from first row in database

    Hiya,


    I'm currently working on a form where I have customer details (from Access DB set up as secondary data source) set to auto populate related fields.  I've done this using rules set to a list box. 

    My problem is that when I preview or test the form, the auto populate will only enter the data set up to the first row in the Access DB, no matter which option I choose from the list. 

    I've seen this problem elsewhere while scouring the forums but I could not find any resolution, apologies if this has been covered somewhere.

    Any help is much appreciated.  Let me know if you need more detail.

    Thank you!
     

  • 07-12-2008 05:35 AM In reply to

    Re: Auto populate - only adds data from first row in database

    Hello and welcome!

    In your rules where you set the value of the fields you wish to auto-populate, are you filtering your data? Let's say that your list box has customer name and you wish to fill a field with the customer phone. When you set your rule, you would first select Set a field's value then select the field where you want the phone number.

    To filter for the correct phone number, select the formula button next to the Value field. In the formula window, select Insert Field or Group. Select your secondary data source and the phone number field. Select the Filter Data ...  button. Select Add. In the first drop down, select the customer name field from your secondary data source. Leave the middle one set to Is equal to. For the third drop down, select the field on your form that is bound to the control with the customer name in it.

    At this point, what you are basically telling the rule is: Go get me a phone number. I want it to belong to the same customer as the one I just selected in my List Box.

    Let me know if you need more help, okay?

    Hilary Stoupa

    Filed under:
  • 07-13-2008 12:12 AM In reply to

    Re: Auto populate - only adds data from first row in database

    Perfect!  Thanks a bunch for the help, I've been messing about with this for a while now!

     

    Thanks again. 

  • 07-23-2008 12:04 PM In reply to

    Re: Auto populate - only adds data from first row in database

    Awesome! I've spent hours trying to figure this out. Thank you!

  • 07-26-2008 05:06 PM In reply to

    • AaronB
    • Not Ranked
    • Joined on 07-24-2008
    • Posts 6

    Re: Auto populate - only adds data from first row in database

    I am having this same issue, but using a SharePoint list as my secondary data source. I followed your instructions, but am still only getting back results for the first item in my list.

  • 07-27-2008 01:28 AM In reply to

    • JamieG
    • Not Ranked
    • Joined on 07-27-2008
    • Posts 2

    Re: Auto populate - only adds data from first row in database

    Hi Hillary,

    Thanks for your post. It has got me half way there but im still having problems. In your scenario, I am trying to display the customer's phone number for reference, not to be submitted as a field in my form, but the number to display is still based on the customer name selected from a drop down box.

     I have the dropdown box populated from a second seondary data source of customer names, ie not the datasource that contains customer names AND customer phone numbers which is used for the lookup. So far it works fine, I load up the form and in my drop down box i have all the customer names. i click on a customer name and that customer's phone number is displayed in a control bound to the customer name/phone number data source. Fine.

     The problem comes when i try afterwards to select a different customer name. The phone number control just goes blank instead of being populated with the phone number of the new selection. I guess what is happening is it is not re-filtering the data source correctly.

     Do you have any suggestions as to how i can fix this?

    Many thanks,

     Jamie

  • 07-27-2008 02:56 AM In reply to

    • JamieG
    • Not Ranked
    • Joined on 07-27-2008
    • Posts 2

    Re: Auto populate - only adds data from first row in database

    I have found the solution on one of Greg Collins' posts http://www.infopathdev.com/forums/p/3218/12339.aspx#12339

     The answer was to set the rule to firstly query the datasource then set the field as described in this post.  

     Thanks Greg and Hillary.

     Jamie

     

  • 09-22-2008 12:22 PM In reply to

    Re: Auto populate - only adds data from first row in database

    I was looking into the same issue and your info worked for me as well.  Thank you!

    Jeff
  • 11-05-2008 10:55 AM In reply to

    Re: Auto populate - only adds data from first row in database

    I am having issues with trying to get this to work. 

    I have two drop downs with two different Secondary data sources.  I want to pick a selection from the first to auto select a choice on the 2nd.

    Drop down 1: Contracts table with a Sales Person ID not on drop down, but in table.

    Drop down 2: Sales People (Name as display, ID as value)

     When I click a contract, I want to take a Salesperson ID from drop down 1 and set it to the value of drop down 2. 

    This scenario will only select the first choice with no filter, when I try to filter, nothing appears on DDL2. 

    Am I having problems due to havng 2 separate data sources?

  • 11-06-2008 10:20 PM In reply to

    Re: Auto populate - only adds data from first row in database

    Hi Hiszorn,

    Please try the following steps:

    1. Double-click on your Dropdown 1 in the view.
    2. In the ListBox entries section, select 'Look Up Values from an external data source', select Contracts as your Data Connection
    3. Click the XPath button to the right of the Entries field. From the dialog box that appears choose your Contracts table and click OK
    4. Click the XPath button to the right of Display Name, select the Contracts field as value to display, and then click OK.
    5. Click Apply, and then click Rules.
    6. Click Add and then click Add Action.
    7. Select Set A Field’s Value from the action drop-down list, and then click the XPath button to the right of Field.
    8. Select /my:myFields/my:<your Dropdown 2> from the list, and then click OK.
    9. Click the formula button to the right of Value, click Insert Field Or Group, select your secondary connection for Contracts table in the Data Source drop-down, and select the node for SalesPersonID in the list and click Filter Data. Click Add
    10. In the first dropdown, select SalesPersonID and leave the second dropdown 'is equal to'.
    11. In the third dropdown, click 'select a field or a group' from dropdown and select Contracts field from your main data source. The formula will look like @SalesPersonID[. = Contracts]
    12. Click ok on all dialog boxes and preview

    When a contract is selected from Dropdown 1, the steps above should take SalesPersonID from Dropdown 1 and set it as value for Dropdown 2

    Hope this helps.

    Jo-Anne AlfafaraQdabra® Software – www.qdabra.com / www.InfoPathDev.com
    The InfoPath Authority – Streamline data gathering to turn process into knowledge.™

     

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-14-2009 01:32 PM In reply to

    Re: Auto populate - only adds data from first row in database

    Hello,

    I followed your instructions and they did the trick quite nicely.  I do have one further issue though, and a follow-up question.  My senario is this:

    I'm creating an infopath form to request new user accounts.  Within this form, I'm using the task pane to display a .html script so the person filling out the form can query another user ID from Active Directory and it will bring up everything the user has access to (Applications and Network Shares).  I want to be able to have the user select an application, and have the form automatically populate the application group and other information.  The data will be stored in an Access Database, which I have connected to the Infopath form.

    1)  When performing this in a repeating table, when selecting an option in the first row, it works great.  When selecting an option in the second row, it returns the value from the first row.  Is there a way to make this work? 

     2)  If I wanted to copy the application name from the task pane, and paste it into a field in a repeating table, is it possible t Validate the data based on the Access database, and have it automatically populate other fields on the form with data in the same line (application groups and licensing information to be precise)?

     
  • 01-07-2010 11:17 AM In reply to

    Re: Auto populate - only adds data from first row in database

    Still struggling with this myself. Sharepoint list has site/adress/city/state/zip info, and is a secondary data connection to my InfoPath form. On the form, the user selects a site from a drop-down, which should auto-populate the four individual address/city/state/zip fields.

     I have a single rule on the "site" drop-down with the following actions:

    • query using a data connection: site list
    • set a field's value: Address = @Site_address
    • set a field's value: City = @City
    • set a field's value: State = @State
    • set a field's value: Zip = @Zip_Postal_Code

    When I preview the form and change the site drop-down, the four address fields only keep the first set of info returned from the SharePoint list.

    Any thoughts on what I'm doing wrong? So close, yet so far...

    Thanks,

    Brian

     

  • 02-22-2012 08:20 PM In reply to

    Re: Auto populate - only adds data from first row in database

    Hi Hilary,

    I am facing the exact same problem. "you have chosen to bind a non repeating control to repeating field or group. this control will be bound to the first item in repeating table or group".

    But in my case, I have to query a web service to retrieve data. and the fields are binded with repeating table in the web service which in my form i have to bind them with non repeating control.

    so can u suggest me a way so that i can get the data of that row which i query using the ID and not just the first one.

     

    Thank you

    Mubashshira

  • 03-01-2012 11:13 PM In reply to

    Re: Auto populate - only adds data from first row in database

    Hi Aaron,

     I am facing the exact same problam. was wondering if you found any solution to your issue.

    AaronB:

    I am having this same issue, but using a SharePoint list as my secondary data source. I followed your instructions, but am still only getting back results for the first item in my list.

    Thanks

  • 03-02-2012 06:40 AM In reply to

    • AaronB
    • Not Ranked
    • Joined on 07-24-2008
    • Posts 6

    Re: Auto populate - only adds data from first row in database

    For me, my issue was that InfoPath would only display the items that were visible in the default list view for the SharePoint list i was using. My default list view had filtered results, so my dropdown in InfoPath would only show the filtered results. I learned to avoid this issue be making sure that any SharePoint list that I use within InfoPath forms has all items displaying on the default list view.

     

Page 1 of 2 (17 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.