Pre-populating an InfoPath from with MySQL data using a .NET web service

InfoPath loves MySql!!!  Ya right…. get real.  Okay here was my task: create a new business card request form in InfoPath with the form fields (name, title, address, phone, fax, email, etc) being prepopulated from our Users table.  Unfortunately, our Users table is still in MySql, and not about to be moved over to MSSQL Server any time soon.  Fortunately, we had previously populated our Users table with domain_username, which was simply the user’s AD account (DOMAIN\username).  Since I know that this information was easily provided by SharePoint and accessible to InfoPath, I decided that this was the solution:

  1. Use the getUserProfile service to retrieve the user’s domain name.
  2. Write a web service to return user information from MySQL (based on AD domain name)
  3. The web service will return the information we need based on the domain name
  4. Populate the form with this data.

Leave a Reply