Populating InfoPath form using Database - InfoPath Dev
in

InfoPath Dev

Populating InfoPath form using Database

Last post 03-22-2012 08:15 AM by Majella. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-16-2011 10:29 AM

    Populating InfoPath form using Database

    Hello,

     I am new to InfoPath and began exploring it a few days ago.

    I have created a form using InfoPath2010 and am wanting to populate the rest of the fields after selecting the users name "FullName". 'FullName' is a drop down and has already had rules applied to it using the following steps:

    http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/cb15a237-28cc-4d6b-8225-83181a7497ff

    The first thing I did when I applied my rules was to use 'Query for Data'. I have no idea if this matters or helps, but I found that information in this link: http://table38.com/ns/?p=9

    I had followed these same steps for the rest of the fields on the form, however when I preview the form and select a name from the drop down, the other fields are not populated with the employees data. However while using 'Telephone' InfoPath forces me to have this code: Field: @FullName| Value: @FullName[@Telephone=@Telephone]...when I use this, instead of 'Telephone' populating the field, the employees name populates after I use the dropdown from 'FullName'. What I mean by force is that when I try to use @Telephone in the Field under Rule Details it shows a (.). Also, I learned if I use @Telephone in the default, then a default number is displayed and when I change the employee name from the 'FullName' drop down, then number stays the same.

    I just started working with InfoPath a few days ago and am wondering if I may need to use binding and what it is for. As you can see I have been to several different places including Stack Over Flow.

    Can you please help me with this? Thank you for your help in advance.

    Richell Grant
  • 02-21-2011 12:09 AM In reply to

    Re: Populating InfoPath form using Database

    Hi CompGeekess,

    So you're trying to filter a SQL data query to show the values based on a field. The first link describes a technique to set up all fields to filter based on another field. Unfortunately, this requires all of the data to be downloaded to the form on load. If there are only 100 sets of data, that should work fine, but if more than that, you'll want to do server side filtering with a web service (for example, Qdabra's DBXL).

    Assuming you have <100 sets of data (and a fast net connection), you can pull the values into your form and use the technique Mike1428 describes to filter the items. You need to use a value (or attribute) that is the ID of the employee. For example, if you're selecting FullName, you can set the value of Telephone based on that. It's the Telephone where the FullName equals the FullName selected in the first dropdown. The xpath filter for that will look like Telephone[2DS\FullName=my:FullName] where 2DS is the secondary data source path where your data exists and my:FullName is the path to the field or attribute in your form's main data source.

    If you aren't using a secondary data source to call the database and are instead using a main data source, then the technique Mike1428 describes does not apply to you. You need to query for the record whenever it changes. Add a rule to your FullName dropdown that queries the data connection for it.

    Sorry this wasn't more detailed, but I would need to see your form. You can attach an XSN to this post and I will review.

    Patrick Halstead
    Project Manager at Qdabra
  • 04-28-2011 06:33 AM In reply to

    Re: Populating InfoPath form using Database

    Please forgive me for responding so late! I didn't receive an email or may have accidentally deleted it, indicating there was a post to my message. As for the task, it is on hold at the moment, while I am trying to see if I can create a list in InfoPath and update a list in SharePoint using the InfoPath List. Someone told me this is not possible because one of the options, when I create my rules on the button does not give SharePoint List, but rather shows SharePoint Library. Also, when I did try to force the InfoPath list to update a SharePoint list, there were no updates. Thank You
    Richell Grant
  • 02-05-2012 02:43 PM In reply to

    • Melina
    • Not Ranked
    • Joined on 02-05-2012
    • Posts 1

    Re: Populating InfoPath form using Database

    Hi I have a table, which needs to retrieve data in three columns from SQL Server. and I will manage other 5 columns myself by using InfoPath 2010. (My table will contain 25 rows totally) I have few questions: 1) which is the best way to pull these columns from Sql Server? 2) I tried the solution in http://table38.com/ns/?p=9 but it does not return any result to me. However the query in "set a field's value" is correct. I will be grateful to answer me. Many thanks
  • 03-22-2012 08:15 AM In reply to

    Re: Populating InfoPath form using Database

    I have the same problem using http://table38.com/ns/?p=9 - no results returned.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.