Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Contents tagged with InfoPath

  • InfoPath: How To Populate a List Control With SharePoint Users

    Since the Service Pack 1 Preview of InfoPath it is really simple to fill for example a drop-down list box on a InfoPath form with data that is stored in a SharePoint list. But it’s not quite straight forward to fill that drop-down list box with all the users of a SharePoint site. Although this is quite easy to accomplish in a custom SharePoint list by creating a Lookup column and indicating that you want to get User Information. But (almost) nothing is impossible with InfoPath, so let’s give it a try!

  • Utilize the Secondary DataSource Data in InfoPath (SharePoint List Example)

    The InfoPath Service Pack1 adds some nice features to InfoPath, there a few that I really like. One of them is the ability to use a SharePoint list as a data source. For example if you have a contact list in SharePoint containing information about your customers, you can easily create a drop-down list box on an InfoPath form, that automatically gets filled with a list of your customers. That’s already nice, but in some cases you may want to fill other fields on your form, based on the selected item of your drop-down list box. For example: you want to display the address of the selected customer on your InfoPath form. This involves a little bit of plumbing code which can be done either in .NET code (by using the InfoPath 2003 Toolkit for Visual Studio.NET) or in Java/VB-script. So because not everyone lives in a managed world today, let’s do it in good old VB-script! (sometime I’m a little bit old fashioned…)

    First of all create a new InfoPath Form. Then put a drop-down list box on your form, double-click on it so we can set the properties. In the “List box entries” section of the properties window, select “Look up values in a data connection to a database, Web Service, file or SharePoint library or list”. When you click the Add-button a wizard shows up which allows you to easily choose a data source. First select of course “SharePoint library or list”, then enter the URL of the SharePoint site that contains the list you want to use. The wizard will retrieve all the lists and libraries on your site, in our example we’ll choose the Contacts list. In the next window you can choose which fields of that list you want to use, make sure you’ve selected the Address and City fields and finish the wizard. Further on the properties window you can choose the XPath expression for the Entries property. By clicking the button right of the Entries textbox, you can easily navigate to the Contacts node. For the Value and Display name properties you can choose something meaningful, for example the Company field. Now if you preview this form, the drop-down list box already contains a list of your customers!

  • Fun with InfoPath: Dynamically Populate a List by Using a Webservice with a Parameter

    Some time ago I started to explore InfoPath, so far it was a pleasant journey. Everbody (including myself) seems to be requesting an user-control version of InfoPath so you can have InfoPath forms in your own Smart Client applications. This would be really great, top of the bill would be integration in Visual Studio.NET, but maybe that's a little bit too wishfull-thinking. Another nice feature would be a free version of InfoPath, without the functionality to create and edit forms. Like there is a free Acrobat Reader and a commercial Acrobat Writer. Microsoft says it's hearing these requests, but has anyone already an idea if these features will be available?