InfoPath Data Connection Performance - Web Service vs SharePoint List Connection

Posted by GeorgeH on November 19, 2010

InfoPath provides functionality to easily retrieve data from a SharePoint list or library. This can be done using the Data Connection Wizard and doesn't require code. Although beneficial in regards to development efforts required, there can be performance issues for this type of configuration if there are a large number of items retrieved from SharePoint. The process of finding and retrieving the list items will take some time, then additional time is required to render or perform actions or calculations on the data. In some cases, only a small number of list items retrieved from SharePoint, so to loop through the entire result set to find and process these items could take a considerable amount of time.

If the InfoPath form is accessed via web browser using InfoPath Form Services, the process will be slower again, as the server must execute queries as well as process and render the data into a web page before it can be sent to the client/browser. When a large number of items are to be included in a view on the form template, such as in a drop down list or selection box, the request will also be large which will take longer to send back and rendered in a browser.

An alternative to using the SharePoint List data connection from InfoPath is to configure a Web Service connection to the Lists web service. The GetListItems method of the web service can be used to retrieve all, or a specific set of results from a SharePoint list. If only a small number of items from a SharePoint list are required by an InfoPath form, the query to the web service can be configure to include criteria that will retrieve only the required items from the list. This eliminates the need to iterate through the entire result set in order to find a small number of items, an will take much less time to execute and retrieve the results from SharePoint.

InfoPath Data Connection Performance - Web Service vs SharePoint List Connection

Another benefit to having a result set that contains only relevant items is that you can quickly render the results in a control or repeating table on an InfoPath form temple. If the GetListItems query is configured using the Data Connections Wizard, it will include the connection in the secondary data sources for the form, which can be accessed either via code or when configuring a control on the form template. If the Lists web service is used in the code behind an InfoPath form, you may need to create and or update a data source to include the results of the query to the Lists web service, or add the results to a repeating group in the forms main data source.

Rating

4/5

Reviews

There are currently no comments or reviews.

Submit a review:

Login required.